mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Merged Ryan's SDL-gui-backend branch.
Adds three APIs, and implements them on X11, Cocoa, and Windows: - SDL_CaptureMouse() - SDL_GetGlobalMouseState() - SDL_SetWindowHitTest()
This commit is contained in:
@@ -44,9 +44,9 @@ static Uint32 SDLTest_AssertsPassed = 0;
|
||||
/*
|
||||
* Assert that logs and break execution flow on failures (i.e. for harness errors).
|
||||
*/
|
||||
void SDLTest_Assert(int assertCondition, const char *assertDescription, ...)
|
||||
void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...)
|
||||
{
|
||||
va_list list;
|
||||
va_list list;
|
||||
char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
|
||||
|
||||
/* Print assert description into a buffer */
|
||||
@@ -56,13 +56,13 @@ void SDLTest_Assert(int assertCondition, const char *assertDescription, ...)
|
||||
va_end(list);
|
||||
|
||||
/* Log, then assert and break on failure */
|
||||
SDL_assert((SDLTest_AssertCheck(assertCondition, logMessage)));
|
||||
SDL_assert((SDLTest_AssertCheck(assertCondition, "%s", logMessage)));
|
||||
}
|
||||
|
||||
/*
|
||||
* Assert that logs but does not break execution flow on failures (i.e. for test cases).
|
||||
*/
|
||||
int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...)
|
||||
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...)
|
||||
{
|
||||
va_list list;
|
||||
char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
|
||||
@@ -91,7 +91,7 @@ int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...)
|
||||
/*
|
||||
* Explicitly passing Assert that logs (i.e. for test cases).
|
||||
*/
|
||||
void SDLTest_AssertPass(const char *assertDescription, ...)
|
||||
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...)
|
||||
{
|
||||
va_list list;
|
||||
char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
|
||||
|
@@ -999,12 +999,10 @@ default: return "???";
|
||||
static void
|
||||
SDLTest_PrintEvent(SDL_Event * event)
|
||||
{
|
||||
#if 0
|
||||
if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
|
||||
/* Mouse and finger motion are really spammy */
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (event->type) {
|
||||
case SDL_WINDOWEVENT:
|
||||
|
@@ -564,7 +564,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
|
||||
execKey = SDLTest_GenerateExecKey((char *)runSeed, testSuite->name, testCase->name, iterationCounter);
|
||||
}
|
||||
|
||||
SDLTest_Log("Test Iteration %i: execKey %llu", iterationCounter, execKey);
|
||||
SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
|
||||
testResult = SDLTest_RunTest(testSuite, testCase, execKey);
|
||||
|
||||
if (testResult == TEST_RESULT_PASSED) {
|
||||
|
@@ -68,7 +68,7 @@ char *SDLTest_TimestampToString(const time_t timestamp)
|
||||
/*
|
||||
* Prints given message with a timestamp in the TEST category and INFO priority.
|
||||
*/
|
||||
void SDLTest_Log(const char *fmt, ...)
|
||||
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
|
||||
@@ -86,7 +86,7 @@ void SDLTest_Log(const char *fmt, ...)
|
||||
/*
|
||||
* Prints given message with a timestamp in the TEST category and the ERROR priority.
|
||||
*/
|
||||
void SDLTest_LogError(const char *fmt, ...)
|
||||
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
{
|
||||
va_list list;
|
||||
char logMessage[SDLTEST_MAX_LOGMESSAGE_LENGTH];
|
||||
|
Reference in New Issue
Block a user