mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 09:44:15 +00:00
Removed the SDL_Version structure, moved SDL version to SDL.h
Inspired by https://github.com/libsdl-org/SDL/issues/9788
This commit is contained in:
@@ -209,41 +209,11 @@ static int platform_testHasFunctions(void *arg)
|
||||
*/
|
||||
static int platform_testGetVersion(void *arg)
|
||||
{
|
||||
SDL_Version linked;
|
||||
int major = SDL_MAJOR_VERSION;
|
||||
int minor = SDL_MINOR_VERSION;
|
||||
|
||||
SDL_GetVersion(&linked);
|
||||
SDLTest_AssertCheck(linked.major >= major,
|
||||
"SDL_GetVersion(): returned major %i (>= %i)",
|
||||
linked.major,
|
||||
major);
|
||||
SDLTest_AssertCheck(linked.minor >= minor,
|
||||
"SDL_GetVersion(): returned minor %i (>= %i)",
|
||||
linked.minor,
|
||||
minor);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests SDL_VERSION macro
|
||||
*/
|
||||
static int platform_testSDLVersion(void *arg)
|
||||
{
|
||||
SDL_Version compiled;
|
||||
int major = SDL_MAJOR_VERSION;
|
||||
int minor = SDL_MINOR_VERSION;
|
||||
|
||||
SDL_VERSION(&compiled);
|
||||
SDLTest_AssertCheck(compiled.major >= major,
|
||||
"SDL_VERSION() returned major %i (>= %i)",
|
||||
compiled.major,
|
||||
major);
|
||||
SDLTest_AssertCheck(compiled.minor >= minor,
|
||||
"SDL_VERSION() returned minor %i (>= %i)",
|
||||
compiled.minor,
|
||||
minor);
|
||||
int linked = SDL_GetVersion();
|
||||
SDLTest_AssertCheck(linked >= SDL_VERSION,
|
||||
"SDL_GetVersion(): returned version %d (>= %d)",
|
||||
linked,
|
||||
SDL_VERSION);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
@@ -544,26 +514,22 @@ static const SDLTest_TestCaseReference platformTest5 = {
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest6 = {
|
||||
(SDLTest_TestCaseFp)platform_testSDLVersion, "platform_testSDLVersion", "Tests SDL_VERSION macro", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest7 = {
|
||||
(SDLTest_TestCaseFp)platform_testDefaultInit, "platform_testDefaultInit", "Tests default SDL_Init", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest8 = {
|
||||
static const SDLTest_TestCaseReference platformTest7 = {
|
||||
(SDLTest_TestCaseFp)platform_testGetSetClearError, "platform_testGetSetClearError", "Tests SDL_Get/Set/ClearError", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest9 = {
|
||||
static const SDLTest_TestCaseReference platformTest8 = {
|
||||
(SDLTest_TestCaseFp)platform_testSetErrorEmptyInput, "platform_testSetErrorEmptyInput", "Tests SDL_SetError with empty input", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest10 = {
|
||||
static const SDLTest_TestCaseReference platformTest9 = {
|
||||
(SDLTest_TestCaseFp)platform_testSetErrorInvalidInput, "platform_testSetErrorInvalidInput", "Tests SDL_SetError with invalid input", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference platformTest11 = {
|
||||
static const SDLTest_TestCaseReference platformTest10 = {
|
||||
(SDLTest_TestCaseFp)platform_testGetPowerInfo, "platform_testGetPowerInfo", "Tests SDL_GetPowerInfo function", TEST_ENABLED
|
||||
};
|
||||
|
||||
@@ -579,7 +545,6 @@ static const SDLTest_TestCaseReference *platformTests[] = {
|
||||
&platformTest8,
|
||||
&platformTest9,
|
||||
&platformTest10,
|
||||
&platformTest11,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_Version compiled;
|
||||
SDL_Version linked;
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
@@ -35,13 +32,12 @@ int main(int argc, char *argv[])
|
||||
#else
|
||||
SDL_Log("Compiled with SDL older than 3.0\n");
|
||||
#endif
|
||||
SDL_VERSION(&compiled);
|
||||
SDL_Log("Compiled version: %d.%d.%d (%s)\n",
|
||||
compiled.major, compiled.minor, compiled.patch,
|
||||
SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_MICRO_VERSION,
|
||||
SDL_REVISION);
|
||||
SDL_GetVersion(&linked);
|
||||
SDL_Log("Linked version: %d.%d.%d (%s)\n",
|
||||
linked.major, linked.minor, linked.patch,
|
||||
int version = SDL_GetVersion();
|
||||
SDL_Log("Runtime version: %d.%d.%d (%s)\n",
|
||||
SDL_VERSIONNUM_MAJOR(version), SDL_VERSIONNUM_MINOR(version), SDL_VERSIONNUM_MICRO(version),
|
||||
SDL_GetRevision());
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user