66 expected =
"1.000000";
83 result =
SDL_snprintf(text,
sizeof(text),
"%f", 1.0 + 1.0 / 3.0);
84 expected =
"1.333333";
89 result =
SDL_snprintf(text,
sizeof(text),
"%+f", 1.0 + 1.0 / 3.0);
90 expected =
"+1.333333";
95 result =
SDL_snprintf(text,
sizeof(text),
"%.2f", 1.0 + 1.0 / 3.0);
101 result =
SDL_snprintf(text,
sizeof(text),
"%6.2f", 1.0 + 1.0 / 3.0);
107 result =
SDL_snprintf(text,
sizeof(text),
"%06.2f", 1.0 + 1.0 / 3.0);
113 result =
SDL_snprintf(text, 5,
"%06.2f", 1.0 + 1.0 / 3.0);
115 SDLTest_AssertPass(
"Call to SDL_snprintf(\"%%06.2f\", 1.0 + 1.0 / 3.0) with buffer size 5");
128 const int nameLen = 16;
141 for(counter = 0; counter < nameLen; counter++) {
144 name[nameLen] =
'\0';
151 }
while (text !=
NULL);
171 "Verify returned text, expected: %s, got: %s",
190 "Verify returned text, expected: %s, got: %s",
209 "Verify returned text, expected: %s, got: %s",
228 "Verify returned text, expected: %s, got: %s",
234 for (overwrite=0; overwrite <= 1; overwrite++) {
268 expected_output = output = 123;
269 expected_result = -1;
272 SDLTest_AssertCheck(expected_output == output,
"Check output, expected: %i, got: %i", expected_output, output);
273 SDLTest_AssertCheck(expected_result == result,
"Check return value, expected: %i, got: %i", expected_result, result);
275 expected_output = output = 123;
279 SDLTest_AssertCheck(expected_output == output,
"Check output, expected: %i, got: %i", expected_output, output);
280 SDLTest_AssertCheck(expected_result == result,
"Check return value, expected: %i, got: %i", expected_result, result);
287 SDLTest_AssertCheck(expected_output == output,
"Check output, expected: %i, got: %i", expected_output, output);
288 SDLTest_AssertCheck(expected_result == result,
"Check return value, expected: %i, got: %i", expected_result, result);
static const SDLTest_TestCaseReference stdlibTest3
static const SDLTest_TestCaseReference * stdlibTests[]
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
static const SDLTest_TestCaseReference stdlibTest2
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(1)
Explicitly pass without checking an assertion condition. Updates assertion counter.
SDLTest_TestSuiteReference stdlibTestSuite
int stdlib_strlcpy(void *arg)
Call to SDL_strlcpy.
static const SDLTest_TestCaseReference stdlibTest1
GLuint const GLchar * name
int(* SDLTest_TestCaseFp)(void *arg)
char * SDLTest_RandomAsciiStringOfSize(int size)
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription,...) SDL_PRINTF_VARARG_FUNC(2)
Assert for test cases that logs but does not break execution flow on failures. Updates assertion coun...
int stdlib_getsetenv(void *arg)
Call to SDL_getenv and SDL_setenv.
int stdlib_snprintf(void *arg)
Call to SDL_snprintf.
static const SDLTest_TestCaseReference stdlibTest4
static char text[MAX_TEXT_LENGTH]
int stdlib_sscanf(void *arg)
Call to SDL_sscanf.
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt,...) SDL_PRINTF_VARARG_FUNC(1)
Prints given message with a timestamp in the TEST category and INFO priority.