More fix warnings about static function and prototype

This commit is contained in:
Sylvain 2023-03-08 16:12:45 +01:00 committed by Sylvain Becker
parent 16bb6a0b3d
commit c963f02571
38 changed files with 262 additions and 257 deletions

View file

@ -964,7 +964,7 @@ static void HIDAPI_DelDevice(SDL_HIDAPI_Device *device)
} }
} }
static SDL_bool HIDAPI_CreateCombinedJoyCons() static SDL_bool HIDAPI_CreateCombinedJoyCons(void)
{ {
SDL_HIDAPI_Device *device, *combined; SDL_HIDAPI_Device *device, *combined;
SDL_HIDAPI_Device *joycons[2] = { NULL, NULL }; SDL_HIDAPI_Device *joycons[2] = { NULL, NULL };

View file

@ -52,19 +52,19 @@ void SDLTest_FuzzerInit(Uint64 execKey)
fuzzerInvocationCounter = 0; fuzzerInvocationCounter = 0;
} }
int SDLTest_GetFuzzerInvocationCount() int SDLTest_GetFuzzerInvocationCount(void)
{ {
return fuzzerInvocationCounter; return fuzzerInvocationCounter;
} }
Uint8 SDLTest_RandomUint8() Uint8 SDLTest_RandomUint8(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
return (Uint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; return (Uint8)SDLTest_RandomInt(&rndContext) & 0x000000FF;
} }
Sint8 SDLTest_RandomSint8() Sint8 SDLTest_RandomSint8(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
@ -72,7 +72,7 @@ Sint8 SDLTest_RandomSint8()
} }
Uint16 Uint16
SDLTest_RandomUint16() SDLTest_RandomUint16(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
@ -80,7 +80,7 @@ SDLTest_RandomUint16()
} }
Sint16 Sint16
SDLTest_RandomSint16() SDLTest_RandomSint16(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
@ -88,7 +88,7 @@ SDLTest_RandomSint16()
} }
Sint32 Sint32
SDLTest_RandomSint32() SDLTest_RandomSint32(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
@ -96,7 +96,7 @@ SDLTest_RandomSint32()
} }
Uint32 Uint32
SDLTest_RandomUint32() SDLTest_RandomUint32(void)
{ {
fuzzerInvocationCounter++; fuzzerInvocationCounter++;
@ -104,7 +104,7 @@ SDLTest_RandomUint32()
} }
Uint64 Uint64
SDLTest_RandomUint64() SDLTest_RandomUint64(void)
{ {
union union
{ {
@ -122,7 +122,7 @@ SDLTest_RandomUint64()
} }
Sint64 Sint64
SDLTest_RandomSint64() SDLTest_RandomSint64(void)
{ {
union union
{ {
@ -422,24 +422,24 @@ SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool v
validDomain); validDomain);
} }
float SDLTest_RandomUnitFloat() float SDLTest_RandomUnitFloat(void)
{ {
return SDLTest_RandomUint32() / (float)UINT_MAX; return SDLTest_RandomUint32() / (float)UINT_MAX;
} }
float SDLTest_RandomFloat() float SDLTest_RandomFloat(void)
{ {
return (float)(SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX)); return (float)(SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX));
} }
double double
SDLTest_RandomUnitDouble() SDLTest_RandomUnitDouble(void)
{ {
return (double)(SDLTest_RandomUint64() >> 11) * (1.0 / 9007199254740992.0); return (double)(SDLTest_RandomUint64() >> 11) * (1.0 / 9007199254740992.0);
} }
double double
SDLTest_RandomDouble() SDLTest_RandomDouble(void)
{ {
double r = 0.0; double r = 0.0;
double s = 1.0; double s = 1.0;
@ -454,7 +454,7 @@ SDLTest_RandomDouble()
} }
char * char *
SDLTest_RandomAsciiString() SDLTest_RandomAsciiString(void)
{ {
return SDLTest_RandomAsciiStringWithMaximumLength(255); return SDLTest_RandomAsciiStringWithMaximumLength(255);
} }

View file

@ -334,7 +334,7 @@ static void SDLTest_LogTestSuiteSummary(SDLTest_TestSuiteReference *testSuites)
#endif #endif
/* Gets a timer value in seconds */ /* Gets a timer value in seconds */
static float GetClock() static float GetClock(void)
{ {
float currentClock = SDL_GetPerformanceCounter() / (float)SDL_GetPerformanceFrequency(); float currentClock = SDL_GetPerformanceCounter() / (float)SDL_GetPerformanceFrequency();
return currentClock; return currentClock;

View file

@ -190,7 +190,7 @@ static void SDLCALL SDLTest_TrackedFree(void *ptr)
SDL_free_orig(ptr); SDL_free_orig(ptr);
} }
int SDLTest_TrackAllocations() int SDLTest_TrackAllocations(void)
{ {
if (SDL_malloc_orig) { if (SDL_malloc_orig) {
return 0; return 0;
@ -215,7 +215,7 @@ int SDLTest_TrackAllocations()
return 0; return 0;
} }
void SDLTest_LogAllocations() void SDLTest_LogAllocations(void)
{ {
char *message = NULL; char *message = NULL;
size_t message_size = 0; size_t message_size = 0;

View file

@ -626,7 +626,7 @@ static SDL_bool KMSDRM_ConnectorCheckVrrCapable(uint32_t drm_fd,
return SDL_FALSE; return SDL_FALSE;
} }
void KMSDRM_CrtcSetVrr(uint32_t drm_fd, uint32_t crtc_id, SDL_bool enabled) static void KMSDRM_CrtcSetVrr(uint32_t drm_fd, uint32_t crtc_id, SDL_bool enabled)
{ {
uint32_t vrr_prop_id; uint32_t vrr_prop_id;
if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) { if (!KMSDRM_VrrPropId(drm_fd, crtc_id, &vrr_prop_id)) {

View file

@ -31,7 +31,7 @@ tf(SDL_bool _tf)
return f; return f;
} }
static void RunBasicTest() static void RunBasicTest(void)
{ {
int value; int value;
SDL_SpinLock lock = 0; SDL_SpinLock lock = 0;
@ -107,11 +107,8 @@ enum
SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */ SDL_COMPILE_TIME_ASSERT(size, CountTo_GreaterThanZero); /* check for rollover */
static SDL_atomic_t good = { 42 }; static SDL_atomic_t good = { 42 };
static atomicValue bad = 42; static atomicValue bad = 42;
static SDL_atomic_t threadsRunning; static SDL_atomic_t threadsRunning;
static SDL_sem *threadDone; static SDL_sem *threadDone;
static int SDLCALL adder(void *junk) static int SDLCALL adder(void *junk)
@ -153,7 +150,7 @@ static void runAdder(void)
SDL_Log("Finished in %f sec\n", (end - start) / 1000000000.0); SDL_Log("Finished in %f sec\n", (end - start) / 1000000000.0);
} }
static void RunEpicTest() static void RunEpicTest(void)
{ {
int b; int b;
atomicValue v; atomicValue v;

View file

@ -25,8 +25,7 @@ static SDL_AudioSpec spec;
static SDL_AudioDeviceID devid_in = 0; static SDL_AudioDeviceID devid_in = 0;
static SDL_AudioDeviceID devid_out = 0; static SDL_AudioDeviceID devid_out = 0;
static void static void loop(void)
loop()
{ {
SDL_bool please_quit = SDL_FALSE; SDL_bool please_quit = SDL_FALSE;
SDL_Event e; SDL_Event e;
@ -164,5 +163,5 @@ int main(int argc, char **argv)
} }
#endif #endif
return 0; /* return 0; */
} }

View file

@ -12,6 +12,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -13,7 +14,7 @@
* *
* \sa SDL_HasClipboardText * \sa SDL_HasClipboardText
*/ */
int clipboard_testHasClipboardText(void *arg) static int clipboard_testHasClipboardText(void *arg)
{ {
SDL_HasClipboardText(); SDL_HasClipboardText();
SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded"); SDLTest_AssertPass("Call to SDL_HasClipboardText succeeded");
@ -26,7 +27,7 @@ int clipboard_testHasClipboardText(void *arg)
* *
* \sa SDL_HasPrimarySelectionText * \sa SDL_HasPrimarySelectionText
*/ */
int clipboard_testHasPrimarySelectionText(void *arg) static int clipboard_testHasPrimarySelectionText(void *arg)
{ {
SDL_HasPrimarySelectionText(); SDL_HasPrimarySelectionText();
SDLTest_AssertPass("Call to SDL_HasPrimarySelectionText succeeded"); SDLTest_AssertPass("Call to SDL_HasPrimarySelectionText succeeded");
@ -39,7 +40,7 @@ int clipboard_testHasPrimarySelectionText(void *arg)
* *
* \sa SDL_GetClipboardText * \sa SDL_GetClipboardText
*/ */
int clipboard_testGetClipboardText(void *arg) static int clipboard_testGetClipboardText(void *arg)
{ {
char *charResult; char *charResult;
charResult = SDL_GetClipboardText(); charResult = SDL_GetClipboardText();
@ -55,7 +56,7 @@ int clipboard_testGetClipboardText(void *arg)
* *
* \sa SDL_GetPrimarySelectionText * \sa SDL_GetPrimarySelectionText
*/ */
int clipboard_testGetPrimarySelectionText(void *arg) static int clipboard_testGetPrimarySelectionText(void *arg)
{ {
char *charResult; char *charResult;
charResult = SDL_GetPrimarySelectionText(); charResult = SDL_GetPrimarySelectionText();
@ -70,7 +71,7 @@ int clipboard_testGetPrimarySelectionText(void *arg)
* \brief Check call to SDL_SetClipboardText * \brief Check call to SDL_SetClipboardText
* \sa SDL_SetClipboardText * \sa SDL_SetClipboardText
*/ */
int clipboard_testSetClipboardText(void *arg) static int clipboard_testSetClipboardText(void *arg)
{ {
char *textRef = SDLTest_RandomAsciiString(); char *textRef = SDLTest_RandomAsciiString();
char *text = SDL_strdup(textRef); char *text = SDL_strdup(textRef);
@ -97,7 +98,7 @@ int clipboard_testSetClipboardText(void *arg)
* \brief Check call to SDL_SetPrimarySelectionText * \brief Check call to SDL_SetPrimarySelectionText
* \sa SDL_SetPrimarySelectionText * \sa SDL_SetPrimarySelectionText
*/ */
int clipboard_testSetPrimarySelectionText(void *arg) static int clipboard_testSetPrimarySelectionText(void *arg)
{ {
char *textRef = SDLTest_RandomAsciiString(); char *textRef = SDLTest_RandomAsciiString();
char *text = SDL_strdup(textRef); char *text = SDL_strdup(textRef);
@ -126,7 +127,7 @@ int clipboard_testSetPrimarySelectionText(void *arg)
* \sa SDL_GetClipboardText * \sa SDL_GetClipboardText
* \sa SDL_SetClipboardText * \sa SDL_SetClipboardText
*/ */
int clipboard_testClipboardTextFunctions(void *arg) static int clipboard_testClipboardTextFunctions(void *arg)
{ {
char *textRef = SDLTest_RandomAsciiString(); char *textRef = SDLTest_RandomAsciiString();
char *text = SDL_strdup(textRef); char *text = SDL_strdup(textRef);
@ -203,7 +204,7 @@ int clipboard_testClipboardTextFunctions(void *arg)
* \sa SDL_GetPrimarySelectionText * \sa SDL_GetPrimarySelectionText
* \sa SDL_SetPrimarySelectionText * \sa SDL_SetPrimarySelectionText
*/ */
int clipboard_testPrimarySelectionTextFunctions(void *arg) static int clipboard_testPrimarySelectionTextFunctions(void *arg)
{ {
char *textRef = SDLTest_RandomAsciiString(); char *textRef = SDLTest_RandomAsciiString();
char *text = SDL_strdup(textRef); char *text = SDL_strdup(textRef);

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -42,7 +43,7 @@ static int SDLCALL events_sampleNullEventFilter(void *userdata, SDL_Event *event
* \sa SDL_PumpEvents * \sa SDL_PumpEvents
* \sa SDL_PollEvent * \sa SDL_PollEvent
*/ */
int events_pushPumpAndPollUserevent(void *arg) static int events_pushPumpAndPollUserevent(void *arg)
{ {
SDL_Event event1; SDL_Event event1;
SDL_Event event2; SDL_Event event2;
@ -75,7 +76,7 @@ int events_pushPumpAndPollUserevent(void *arg)
* \sa SDL_DelEventWatch * \sa SDL_DelEventWatch
* *
*/ */
int events_addDelEventWatch(void *arg) static int events_addDelEventWatch(void *arg)
{ {
SDL_Event event; SDL_Event event;
@ -124,7 +125,7 @@ int events_addDelEventWatch(void *arg)
* \sa SDL_DelEventWatch * \sa SDL_DelEventWatch
* *
*/ */
int events_addDelEventWatchWithUserdata(void *arg) static int events_addDelEventWatchWithUserdata(void *arg)
{ {
SDL_Event event; SDL_Event event;

View file

@ -4,6 +4,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */

View file

@ -4,8 +4,9 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
const char *HintsEnum[] = { static const char *HintsEnum[] = {
SDL_HINT_ACCELEROMETER_AS_JOYSTICK, SDL_HINT_ACCELEROMETER_AS_JOYSTICK,
SDL_HINT_FRAMEBUFFER_ACCELERATION, SDL_HINT_FRAMEBUFFER_ACCELERATION,
SDL_HINT_GAMECONTROLLERCONFIG, SDL_HINT_GAMECONTROLLERCONFIG,
@ -28,7 +29,7 @@ const char *HintsEnum[] = {
SDL_HINT_VIDEO_X11_XRANDR, SDL_HINT_VIDEO_X11_XRANDR,
SDL_HINT_XINPUT_ENABLED, SDL_HINT_XINPUT_ENABLED,
}; };
const char *HintsVerbose[] = { static const char *HintsVerbose[] = {
"SDL_ACCELEROMETER_AS_JOYSTICK", "SDL_ACCELEROMETER_AS_JOYSTICK",
"SDL_FRAMEBUFFER_ACCELERATION", "SDL_FRAMEBUFFER_ACCELERATION",
"SDL_GAMECONTROLLERCONFIG", "SDL_GAMECONTROLLERCONFIG",
@ -54,14 +55,14 @@ const char *HintsVerbose[] = {
SDL_COMPILE_TIME_ASSERT(HintsEnum, SDL_arraysize(HintsEnum) == SDL_arraysize(HintsVerbose)); SDL_COMPILE_TIME_ASSERT(HintsEnum, SDL_arraysize(HintsEnum) == SDL_arraysize(HintsVerbose));
const int numHintsEnum = SDL_arraysize(HintsEnum); static const int numHintsEnum = SDL_arraysize(HintsEnum);
/* Test case functions */ /* Test case functions */
/** /**
* \brief Call to SDL_GetHint * \brief Call to SDL_GetHint
*/ */
int hints_getHint(void *arg) static int hints_getHint(void *arg)
{ {
const char *result1; const char *result1;
const char *result2; const char *result2;
@ -90,7 +91,7 @@ static void SDLCALL hints_testHintChanged(void *userdata, const char *name, cons
/** /**
* \brief Call to SDL_SetHint * \brief Call to SDL_SetHint
*/ */
int hints_setHint(void *arg) static int hints_setHint(void *arg)
{ {
const char *testHint = "SDL_AUTOMATED_TEST_HINT"; const char *testHint = "SDL_AUTOMATED_TEST_HINT";
const char *originalValue; const char *originalValue;

View file

@ -530,7 +530,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlit = {
/** /**
* \brief Returns the Blit test image as SDL_Surface. * \brief Returns the Blit test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlit() SDL_Surface *SDLTest_ImageBlit(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlit.pixel_data, (void *)SDLTest_imageBlit.pixel_data,
@ -1002,7 +1002,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = {
/** /**
* \brief Returns the BlitColor test image as SDL_Surface. * \brief Returns the BlitColor test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitColor() SDL_Surface *SDLTest_ImageBlitColor(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitColor.pixel_data, (void *)SDLTest_imageBlitColor.pixel_data,
@ -1637,7 +1637,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = {
/** /**
* \brief Returns the BlitAlpha test image as SDL_Surface. * \brief Returns the BlitAlpha test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitAlpha() SDL_Surface *SDLTest_ImageBlitAlpha(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitAlpha.pixel_data, (void *)SDLTest_imageBlitAlpha.pixel_data,
@ -2205,7 +2205,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = {
/** /**
* \brief Returns the BlitBlendAdd test image as SDL_Surface. * \brief Returns the BlitBlendAdd test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitBlendAdd() SDL_Surface *SDLTest_ImageBlitBlendAdd(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitBlendAdd.pixel_data, (void *)SDLTest_imageBlitBlendAdd.pixel_data,
@ -2794,7 +2794,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = {
/** /**
* \brief Returns the BlitBlend test image as SDL_Surface. * \brief Returns the BlitBlend test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitBlend() SDL_Surface *SDLTest_ImageBlitBlend(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitBlend.pixel_data, (void *)SDLTest_imageBlitBlend.pixel_data,
@ -3213,7 +3213,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = {
/** /**
* \brief Returns the BlitBlendMod test image as SDL_Surface. * \brief Returns the BlitBlendMod test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitBlendMod() SDL_Surface *SDLTest_ImageBlitBlendMod(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitBlendMod.pixel_data, (void *)SDLTest_imageBlitBlendMod.pixel_data,
@ -4015,7 +4015,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = {
/** /**
* \brief Returns the BlitBlendNone test image as SDL_Surface. * \brief Returns the BlitBlendNone test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitBlendNone() SDL_Surface *SDLTest_ImageBlitBlendNone(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitBlendNone.pixel_data, (void *)SDLTest_imageBlitBlendNone.pixel_data,
@ -4549,7 +4549,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = {
/** /**
* \brief Returns the BlitBlendAll test image as SDL_Surface. * \brief Returns the BlitBlendAll test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageBlitBlendAll() SDL_Surface *SDLTest_ImageBlitBlendAll(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageBlitBlendAll.pixel_data, (void *)SDLTest_imageBlitBlendAll.pixel_data,
@ -4760,7 +4760,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imageFace = {
/** /**
* \brief Returns the Face test image as SDL_Surface. * \brief Returns the Face test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImageFace() SDL_Surface *SDLTest_ImageFace(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imageFace.pixel_data, (void *)SDLTest_imageFace.pixel_data,
@ -5253,7 +5253,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = {
/** /**
* \brief Returns the Primitives test image as SDL_Surface. * \brief Returns the Primitives test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImagePrimitives() SDL_Surface *SDLTest_ImagePrimitives(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imagePrimitives.pixel_data, (void *)SDLTest_imagePrimitives.pixel_data,
@ -5918,7 +5918,7 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = {
/** /**
* \brief Returns the PrimitivesBlend test image as SDL_Surface. * \brief Returns the PrimitivesBlend test image as SDL_Surface.
*/ */
SDL_Surface *SDLTest_ImagePrimitivesBlend() SDL_Surface *SDLTest_ImagePrimitivesBlend(void)
{ {
SDL_Surface *surface = SDL_CreateSurfaceFrom( SDL_Surface *surface = SDL_CreateSurfaceFrom(
(void *)SDLTest_imagePrimitivesBlend.pixel_data, (void *)SDLTest_imagePrimitivesBlend.pixel_data,

View file

@ -5,6 +5,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "../src/joystick/usb_ids.h" #include "../src/joystick/usb_ids.h"
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -15,8 +16,7 @@
* *
* \sa SDL_AttachVirtualJoystickEx * \sa SDL_AttachVirtualJoystickEx
*/ */
static int static int TestVirtualJoystick(void *arg)
TestVirtualJoystick(void *arg)
{ {
SDL_VirtualJoystickDesc desc; SDL_VirtualJoystickDesc desc;
SDL_Joystick *joystick = NULL; SDL_Joystick *joystick = NULL;

View file

@ -4,6 +4,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -14,7 +15,7 @@
* *
* \sa SDL_GetKeyboardState * \sa SDL_GetKeyboardState
*/ */
int keyboard_getKeyboardState(void *arg) static int keyboard_getKeyboardState(void *arg)
{ {
int numkeys; int numkeys;
Uint8 *state; Uint8 *state;
@ -39,7 +40,7 @@ int keyboard_getKeyboardState(void *arg)
* *
* \sa SDL_GetKeyboardFocus * \sa SDL_GetKeyboardFocus
*/ */
int keyboard_getKeyboardFocus(void *arg) static int keyboard_getKeyboardFocus(void *arg)
{ {
/* Call, but ignore return value */ /* Call, but ignore return value */
SDL_GetKeyboardFocus(); SDL_GetKeyboardFocus();
@ -53,7 +54,7 @@ int keyboard_getKeyboardFocus(void *arg)
* *
* \sa SDL_GetKeyFromName * \sa SDL_GetKeyFromName
*/ */
int keyboard_getKeyFromName(void *arg) static int keyboard_getKeyFromName(void *arg)
{ {
SDL_Keycode result; SDL_Keycode result;
@ -98,7 +99,7 @@ int keyboard_getKeyFromName(void *arg)
/* /*
* Local helper to check for the invalid scancode error message * Local helper to check for the invalid scancode error message
*/ */
static void checkInvalidScancodeError() static void checkInvalidScancodeError(void)
{ {
const char *expectedError = "Parameter 'scancode' is invalid"; const char *expectedError = "Parameter 'scancode' is invalid";
const char *error; const char *error;
@ -118,7 +119,7 @@ static void checkInvalidScancodeError()
* *
* \sa SDL_GetKeyFromScancode * \sa SDL_GetKeyFromScancode
*/ */
int keyboard_getKeyFromScancode(void *arg) static int keyboard_getKeyFromScancode(void *arg)
{ {
SDL_Keycode result; SDL_Keycode result;
@ -156,7 +157,7 @@ int keyboard_getKeyFromScancode(void *arg)
* *
* \sa SDL_GetKeyName * \sa SDL_GetKeyName
*/ */
int keyboard_getKeyName(void *arg) static int keyboard_getKeyName(void *arg)
{ {
const char *result; const char *result;
const char *expected; const char *expected;
@ -211,7 +212,7 @@ int keyboard_getKeyName(void *arg)
* *
* \sa SDL_GetScancodeName * \sa SDL_GetScancodeName
*/ */
int keyboard_getScancodeNameNegative(void *arg) static int keyboard_getScancodeNameNegative(void *arg)
{ {
SDL_Scancode scancode; SDL_Scancode scancode;
const char *result; const char *result;
@ -237,7 +238,7 @@ int keyboard_getScancodeNameNegative(void *arg)
* *
* \sa SDL_GetKeyName * \sa SDL_GetKeyName
*/ */
int keyboard_getKeyNameNegative(void *arg) static int keyboard_getKeyNameNegative(void *arg)
{ {
SDL_Keycode keycode; SDL_Keycode keycode;
const char *result; const char *result;
@ -274,7 +275,7 @@ int keyboard_getKeyNameNegative(void *arg)
* \sa SDL_GetModState * \sa SDL_GetModState
* \sa SDL_SetModState * \sa SDL_SetModState
*/ */
int keyboard_getSetModState(void *arg) static int keyboard_getSetModState(void *arg)
{ {
SDL_Keymod result; SDL_Keymod result;
SDL_Keymod currentState; SDL_Keymod currentState;
@ -333,7 +334,7 @@ int keyboard_getSetModState(void *arg)
* \sa SDL_StartTextInput * \sa SDL_StartTextInput
* \sa SDL_StopTextInput * \sa SDL_StopTextInput
*/ */
int keyboard_startStopTextInput(void *arg) static int keyboard_startStopTextInput(void *arg)
{ {
/* Start-Stop */ /* Start-Stop */
SDL_StartTextInput(); SDL_StartTextInput();
@ -378,7 +379,7 @@ static void testSetTextInputRect(SDL_Rect refRect)
* *
* \sa SDL_SetTextInputRect * \sa SDL_SetTextInputRect
*/ */
int keyboard_setTextInputRect(void *arg) static int keyboard_setTextInputRect(void *arg)
{ {
SDL_Rect refRect; SDL_Rect refRect;
@ -457,7 +458,7 @@ int keyboard_setTextInputRect(void *arg)
* *
* \sa SDL_SetTextInputRect * \sa SDL_SetTextInputRect
*/ */
int keyboard_setTextInputRectNegative(void *arg) static int keyboard_setTextInputRectNegative(void *arg)
{ {
/* Some platforms set also an error message; prepare for checking it */ /* Some platforms set also an error message; prepare for checking it */
#if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA #if SDL_VIDEO_DRIVER_WINDOWS || SDL_VIDEO_DRIVER_ANDROID || SDL_VIDEO_DRIVER_COCOA
@ -495,7 +496,7 @@ int keyboard_setTextInputRectNegative(void *arg)
* \sa SDL_GetScancodeFromKey * \sa SDL_GetScancodeFromKey
* \sa SDL_Keycode * \sa SDL_Keycode
*/ */
int keyboard_getScancodeFromKey(void *arg) static int keyboard_getScancodeFromKey(void *arg)
{ {
SDL_Scancode scancode; SDL_Scancode scancode;
@ -518,7 +519,7 @@ int keyboard_getScancodeFromKey(void *arg)
* \sa SDL_GetScancodeFromName * \sa SDL_GetScancodeFromName
* \sa SDL_Keycode * \sa SDL_Keycode
*/ */
int keyboard_getScancodeFromName(void *arg) static int keyboard_getScancodeFromName(void *arg)
{ {
SDL_Scancode scancode; SDL_Scancode scancode;
@ -568,7 +569,7 @@ int keyboard_getScancodeFromName(void *arg)
/* /*
* Local helper to check for the invalid scancode error message * Local helper to check for the invalid scancode error message
*/ */
static void checkInvalidNameError() static void checkInvalidNameError(void)
{ {
const char *expectedError = "Parameter 'name' is invalid"; const char *expectedError = "Parameter 'name' is invalid";
const char *error; const char *error;
@ -589,7 +590,7 @@ static void checkInvalidNameError()
* \sa SDL_GetScancodeFromName * \sa SDL_GetScancodeFromName
* \sa SDL_Keycode * \sa SDL_Keycode
*/ */
int keyboard_getScancodeFromNameNegative(void *arg) static int keyboard_getScancodeFromNameNegative(void *arg)
{ {
const char *name; const char *name;
SDL_Scancode scancode; SDL_Scancode scancode;

View file

@ -8,6 +8,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/** /**
* \brief Tests SDL_InitSubSystem() and SDL_QuitSubSystem() * \brief Tests SDL_InitSubSystem() and SDL_QuitSubSystem()
@ -37,7 +38,7 @@ static int main_testInitQuitSubSystem(void *arg)
return TEST_COMPLETED; return TEST_COMPLETED;
} }
const int joy_and_controller = SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD; static const int joy_and_controller = SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD;
static int main_testImpliedJoystickInit(void *arg) static int main_testImpliedJoystickInit(void *arg)
{ {
int initialized_system; int initialized_system;

View file

@ -7,6 +7,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Constants ================== */ /* ================= Test Constants ================== */

View file

@ -6,6 +6,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
#include "testautomation_images.h" #include "testautomation_images.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -27,7 +28,7 @@ static int mouseStateCheck(Uint32 state)
* \brief Check call to SDL_GetMouseState * \brief Check call to SDL_GetMouseState
* *
*/ */
int mouse_getMouseState(void *arg) static int mouse_getMouseState(void *arg)
{ {
float x; float x;
float y; float y;
@ -72,7 +73,7 @@ int mouse_getMouseState(void *arg)
* \brief Check call to SDL_GetRelativeMouseState * \brief Check call to SDL_GetRelativeMouseState
* *
*/ */
int mouse_getRelativeMouseState(void *arg) static int mouse_getRelativeMouseState(void *arg)
{ {
float x; float x;
float y; float y;
@ -192,7 +193,7 @@ static SDL_Cursor *initArrowCursor(const char *image[])
* \sa SDL_CreateCursor * \sa SDL_CreateCursor
* \sa SDL_DestroyCursor * \sa SDL_DestroyCursor
*/ */
int mouse_createFreeCursor(void *arg) static int mouse_createFreeCursor(void *arg)
{ {
SDL_Cursor *cursor; SDL_Cursor *cursor;
@ -217,7 +218,7 @@ int mouse_createFreeCursor(void *arg)
* \sa SDL_CreateColorCursor * \sa SDL_CreateColorCursor
* \sa SDL_DestroyCursor * \sa SDL_DestroyCursor
*/ */
int mouse_createFreeColorCursor(void *arg) static int mouse_createFreeColorCursor(void *arg)
{ {
SDL_Surface *face; SDL_Surface *face;
SDL_Cursor *cursor; SDL_Cursor *cursor;
@ -272,7 +273,7 @@ static void changeCursorVisibility(SDL_bool state)
* *
* \sa SDL_ShowCursor * \sa SDL_ShowCursor
*/ */
int mouse_showCursor(void *arg) static int mouse_showCursor(void *arg)
{ {
SDL_bool currentState; SDL_bool currentState;
@ -297,7 +298,7 @@ int mouse_showCursor(void *arg)
* *
* \sa SDL_SetCursor * \sa SDL_SetCursor
*/ */
int mouse_setCursor(void *arg) static int mouse_setCursor(void *arg)
{ {
SDL_Cursor *cursor; SDL_Cursor *cursor;
@ -329,7 +330,7 @@ int mouse_setCursor(void *arg)
* *
* \sa SDL_GetCursor * \sa SDL_GetCursor
*/ */
int mouse_getCursor(void *arg) static int mouse_getCursor(void *arg)
{ {
SDL_Cursor *cursor; SDL_Cursor *cursor;
@ -347,7 +348,7 @@ int mouse_getCursor(void *arg)
* \sa SDL_GetRelativeMouseMode * \sa SDL_GetRelativeMouseMode
* \sa SDL_SetRelativeMouseMode * \sa SDL_SetRelativeMouseMode
*/ */
int mouse_getSetRelativeMouseMode(void *arg) static int mouse_getSetRelativeMouseMode(void *arg)
{ {
int result; int result;
int i; int i;
@ -402,7 +403,7 @@ int mouse_getSetRelativeMouseMode(void *arg)
/** /**
* Creates a test window * Creates a test window
*/ */
static SDL_Window *createMouseSuiteTestWindow() static SDL_Window *createMouseSuiteTestWindow(void)
{ {
int width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT; int width = MOUSE_TESTWINDOW_WIDTH, height = MOUSE_TESTWINDOW_HEIGHT;
SDL_Window *window; SDL_Window *window;
@ -429,7 +430,7 @@ static void destroyMouseSuiteTestWindow(SDL_Window *window)
* *
* \sa SDL_WarpMouseInWindow * \sa SDL_WarpMouseInWindow
*/ */
int mouse_warpMouseInWindow(void *arg) static int mouse_warpMouseInWindow(void *arg)
{ {
const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT; const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT;
int numPositions = 6; int numPositions = 6;
@ -492,7 +493,7 @@ int mouse_warpMouseInWindow(void *arg)
* *
* \sa SDL_GetMouseFocus * \sa SDL_GetMouseFocus
*/ */
int mouse_getMouseFocus(void *arg) static int mouse_getMouseFocus(void *arg)
{ {
const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT; const int w = MOUSE_TESTWINDOW_WIDTH, h = MOUSE_TESTWINDOW_HEIGHT;
float x, y; float x, y;
@ -552,7 +553,7 @@ int mouse_getMouseFocus(void *arg)
* *
* \sa SDL_GetDefaultCursor * \sa SDL_GetDefaultCursor
*/ */
int mouse_getDefaultCursor(void *arg) static int mouse_getDefaultCursor(void *arg)
{ {
SDL_Cursor *cursor; SDL_Cursor *cursor;
@ -569,7 +570,7 @@ int mouse_getDefaultCursor(void *arg)
* *
* \sa SDL_GetGlobalMouseState * \sa SDL_GetGlobalMouseState
*/ */
int mouse_getGlobalMouseState(void *arg) static int mouse_getGlobalMouseState(void *arg)
{ {
float x; float x;
float y; float y;

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Test case functions */ /* Test case functions */

View file

@ -4,6 +4,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -26,7 +27,7 @@ static int compareSizeOfType(size_t sizeoftype, size_t hardcodetype)
/** /**
* \brief Tests type sizes. * \brief Tests type sizes.
*/ */
int platform_testTypes(void *arg) static int platform_testTypes(void *arg)
{ {
int ret; int ret;
@ -48,7 +49,7 @@ int platform_testTypes(void *arg)
/** /**
* \brief Tests platform endianness and SDL_SwapXY functions. * \brief Tests platform endianness and SDL_SwapXY functions.
*/ */
int platform_testEndianessAndSwap(void *arg) static int platform_testEndianessAndSwap(void *arg)
{ {
int real_byteorder; int real_byteorder;
int real_floatwordorder = 0; int real_floatwordorder = 0;
@ -123,7 +124,7 @@ int platform_testEndianessAndSwap(void *arg)
* \sa SDL_GetRevision * \sa SDL_GetRevision
* \sa SDL_GetCPUCacheLineSize * \sa SDL_GetCPUCacheLineSize
*/ */
int platform_testGetFunctions(void *arg) static int platform_testGetFunctions(void *arg)
{ {
char *platform; char *platform;
char *revision; char *revision;
@ -172,7 +173,7 @@ int platform_testGetFunctions(void *arg)
* \sa SDL_HasSSE42 * \sa SDL_HasSSE42
* \sa SDL_HasAVX * \sa SDL_HasAVX
*/ */
int platform_testHasFunctions(void *arg) static int platform_testHasFunctions(void *arg)
{ {
/* TODO: independently determine and compare values as well */ /* TODO: independently determine and compare values as well */
@ -210,7 +211,7 @@ int platform_testHasFunctions(void *arg)
* \brief Tests SDL_GetVersion * \brief Tests SDL_GetVersion
* \sa SDL_GetVersion * \sa SDL_GetVersion
*/ */
int platform_testGetVersion(void *arg) static int platform_testGetVersion(void *arg)
{ {
SDL_version linked; SDL_version linked;
int major = SDL_MAJOR_VERSION; int major = SDL_MAJOR_VERSION;
@ -232,7 +233,7 @@ int platform_testGetVersion(void *arg)
/** /**
* \brief Tests SDL_VERSION macro * \brief Tests SDL_VERSION macro
*/ */
int platform_testSDLVersion(void *arg) static int platform_testSDLVersion(void *arg)
{ {
SDL_version compiled; SDL_version compiled;
int major = SDL_MAJOR_VERSION; int major = SDL_MAJOR_VERSION;
@ -254,7 +255,7 @@ int platform_testSDLVersion(void *arg)
/** /**
* \brief Tests default SDL_Init * \brief Tests default SDL_Init
*/ */
int platform_testDefaultInit(void *arg) static int platform_testDefaultInit(void *arg)
{ {
int ret; int ret;
int subsystem; int subsystem;
@ -279,7 +280,7 @@ int platform_testDefaultInit(void *arg)
* \sa SDL_SetError * \sa SDL_SetError
* \sa SDL_ClearError * \sa SDL_ClearError
*/ */
int platform_testGetSetClearError(void *arg) static int platform_testGetSetClearError(void *arg)
{ {
int result; int result;
const char *testError = "Testing"; const char *testError = "Testing";
@ -328,7 +329,7 @@ int platform_testGetSetClearError(void *arg)
* \brief Tests SDL_SetError with empty input * \brief Tests SDL_SetError with empty input
* \sa SDL_SetError * \sa SDL_SetError
*/ */
int platform_testSetErrorEmptyInput(void *arg) static int platform_testSetErrorEmptyInput(void *arg)
{ {
int result; int result;
const char *testError = ""; const char *testError = "";
@ -369,7 +370,7 @@ int platform_testSetErrorEmptyInput(void *arg)
* \brief Tests SDL_SetError with invalid input * \brief Tests SDL_SetError with invalid input
* \sa SDL_SetError * \sa SDL_SetError
*/ */
int platform_testSetErrorInvalidInput(void *arg) static int platform_testSetErrorInvalidInput(void *arg)
{ {
int result; int result;
const char *invalidError = NULL; const char *invalidError = NULL;
@ -452,7 +453,7 @@ int platform_testSetErrorInvalidInput(void *arg)
* \brief Tests SDL_GetPowerInfo * \brief Tests SDL_GetPowerInfo
* \sa SDL_GetPowerInfo * \sa SDL_GetPowerInfo
*/ */
int platform_testGetPowerInfo(void *arg) static int platform_testGetPowerInfo(void *arg)
{ {
SDL_PowerState state; SDL_PowerState state;
SDL_PowerState stateAgain; SDL_PowerState stateAgain;

View file

@ -4,6 +4,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -41,7 +42,7 @@ static void validateIntersectRectAndLineResults(
* *
* \sa SDL_GetRectAndLineIntersection * \sa SDL_GetRectAndLineIntersection
*/ */
int rect_testIntersectRectAndLine(void *arg) static int rect_testIntersectRectAndLine(void *arg)
{ {
SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect; SDL_Rect rect;
@ -110,7 +111,7 @@ int rect_testIntersectRectAndLine(void *arg)
* *
* \sa SDL_GetRectAndLineIntersection * \sa SDL_GetRectAndLineIntersection
*/ */
int rect_testIntersectRectAndLineInside(void *arg) static int rect_testIntersectRectAndLineInside(void *arg)
{ {
SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect; SDL_Rect rect;
@ -175,7 +176,7 @@ int rect_testIntersectRectAndLineInside(void *arg)
* *
* \sa SDL_GetRectAndLineIntersection * \sa SDL_GetRectAndLineIntersection
*/ */
int rect_testIntersectRectAndLineOutside(void *arg) static int rect_testIntersectRectAndLineOutside(void *arg)
{ {
SDL_Rect refRect = { 0, 0, 32, 32 }; SDL_Rect refRect = { 0, 0, 32, 32 };
SDL_Rect rect; SDL_Rect rect;
@ -228,7 +229,7 @@ int rect_testIntersectRectAndLineOutside(void *arg)
* *
* \sa SDL_GetRectAndLineIntersection * \sa SDL_GetRectAndLineIntersection
*/ */
int rect_testIntersectRectAndLineEmpty(void *arg) static int rect_testIntersectRectAndLineEmpty(void *arg)
{ {
SDL_Rect refRect; SDL_Rect refRect;
SDL_Rect rect; SDL_Rect rect;
@ -261,7 +262,7 @@ int rect_testIntersectRectAndLineEmpty(void *arg)
* *
* \sa SDL_GetRectAndLineIntersection * \sa SDL_GetRectAndLineIntersection
*/ */
int rect_testIntersectRectAndLineParam(void *arg) static int rect_testIntersectRectAndLineParam(void *arg)
{ {
SDL_Rect rect = { 0, 0, 32, 32 }; SDL_Rect rect = { 0, 0, 32, 32 };
int x1 = rect.w / 2; int x1 = rect.w / 2;
@ -426,7 +427,7 @@ static void validateFRectEqualsResults(
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectInside(void *arg) static int rect_testIntersectRectInside(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -453,7 +454,7 @@ int rect_testIntersectRectInside(void *arg)
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectOutside(void *arg) static int rect_testIntersectRectOutside(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -480,7 +481,7 @@ int rect_testIntersectRectOutside(void *arg)
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectPartial(void *arg) static int rect_testIntersectRectPartial(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -568,7 +569,7 @@ int rect_testIntersectRectPartial(void *arg)
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectPoint(void *arg) static int rect_testIntersectRectPoint(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 1, 1 }; SDL_Rect refRectA = { 0, 0, 1, 1 };
SDL_Rect refRectB = { 0, 0, 1, 1 }; SDL_Rect refRectB = { 0, 0, 1, 1 };
@ -614,7 +615,7 @@ int rect_testIntersectRectPoint(void *arg)
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectEmpty(void *arg) static int rect_testIntersectRectEmpty(void *arg)
{ {
SDL_Rect refRectA; SDL_Rect refRectA;
SDL_Rect refRectB; SDL_Rect refRectB;
@ -685,7 +686,7 @@ int rect_testIntersectRectEmpty(void *arg)
* *
* \sa SDL_GetRectIntersection * \sa SDL_GetRectIntersection
*/ */
int rect_testIntersectRectParam(void *arg) static int rect_testIntersectRectParam(void *arg)
{ {
SDL_Rect rectA; SDL_Rect rectA;
SDL_Rect rectB = { 0 }; SDL_Rect rectB = { 0 };
@ -714,7 +715,7 @@ int rect_testIntersectRectParam(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionInside(void *arg) static int rect_testHasIntersectionInside(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -740,7 +741,7 @@ int rect_testHasIntersectionInside(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionOutside(void *arg) static int rect_testHasIntersectionOutside(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -766,7 +767,7 @@ int rect_testHasIntersectionOutside(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionPartial(void *arg) static int rect_testHasIntersectionPartial(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 32, 32 }; SDL_Rect refRectA = { 0, 0, 32, 32 };
SDL_Rect refRectB; SDL_Rect refRectB;
@ -832,7 +833,7 @@ int rect_testHasIntersectionPartial(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionPoint(void *arg) static int rect_testHasIntersectionPoint(void *arg)
{ {
SDL_Rect refRectA = { 0, 0, 1, 1 }; SDL_Rect refRectA = { 0, 0, 1, 1 };
SDL_Rect refRectB = { 0, 0, 1, 1 }; SDL_Rect refRectB = { 0, 0, 1, 1 };
@ -877,7 +878,7 @@ int rect_testHasIntersectionPoint(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionEmpty(void *arg) static int rect_testHasIntersectionEmpty(void *arg)
{ {
SDL_Rect refRectA; SDL_Rect refRectA;
SDL_Rect refRectB; SDL_Rect refRectB;
@ -934,7 +935,7 @@ int rect_testHasIntersectionEmpty(void *arg)
* *
* \sa SDL_HasRectIntersection * \sa SDL_HasRectIntersection
*/ */
int rect_testHasIntersectionParam(void *arg) static int rect_testHasIntersectionParam(void *arg)
{ {
SDL_Rect rectA; SDL_Rect rectA;
SDL_Rect rectB = { 0 }; SDL_Rect rectB = { 0 };
@ -956,7 +957,7 @@ int rect_testHasIntersectionParam(void *arg)
* *
* \sa SDL_GetRectEnclosingPoints * \sa SDL_GetRectEnclosingPoints
*/ */
int rect_testEnclosePoints(void *arg) static int rect_testEnclosePoints(void *arg)
{ {
const int numPoints = 16; const int numPoints = 16;
SDL_Point refPoints[16]; SDL_Point refPoints[16];
@ -1033,7 +1034,7 @@ int rect_testEnclosePoints(void *arg)
* *
* \sa SDL_GetRectEnclosingPoints * \sa SDL_GetRectEnclosingPoints
*/ */
int rect_testEnclosePointsRepeatedInput(void *arg) static int rect_testEnclosePointsRepeatedInput(void *arg)
{ {
const int numPoints = 8; const int numPoints = 8;
const int halfPoints = 4; const int halfPoints = 4;
@ -1116,7 +1117,7 @@ int rect_testEnclosePointsRepeatedInput(void *arg)
* *
* \sa SDL_GetRectEnclosingPoints * \sa SDL_GetRectEnclosingPoints
*/ */
int rect_testEnclosePointsWithClipping(void *arg) static int rect_testEnclosePointsWithClipping(void *arg)
{ {
const int numPoints = 16; const int numPoints = 16;
SDL_Point refPoints[16]; SDL_Point refPoints[16];
@ -1222,7 +1223,7 @@ int rect_testEnclosePointsWithClipping(void *arg)
* *
* \sa SDL_GetRectEnclosingPoints * \sa SDL_GetRectEnclosingPoints
*/ */
int rect_testEnclosePointsParam(void *arg) static int rect_testEnclosePointsParam(void *arg)
{ {
SDL_Point points[1]; SDL_Point points[1];
int count; int count;
@ -1249,7 +1250,7 @@ int rect_testEnclosePointsParam(void *arg)
* *
* \sa SDL_GetRectUnion * \sa SDL_GetRectUnion
*/ */
int rect_testUnionRectOutside(void *arg) static int rect_testUnionRectOutside(void *arg)
{ {
SDL_Rect refRectA, refRectB; SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB; SDL_Rect rectA, rectB;
@ -1327,7 +1328,7 @@ int rect_testUnionRectOutside(void *arg)
* *
* \sa SDL_GetRectUnion * \sa SDL_GetRectUnion
*/ */
int rect_testUnionRectEmpty(void *arg) static int rect_testUnionRectEmpty(void *arg)
{ {
SDL_Rect refRectA, refRectB; SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB; SDL_Rect rectA, rectB;
@ -1391,7 +1392,7 @@ int rect_testUnionRectEmpty(void *arg)
* *
* \sa SDL_GetRectUnion * \sa SDL_GetRectUnion
*/ */
int rect_testUnionRectInside(void *arg) static int rect_testUnionRectInside(void *arg)
{ {
SDL_Rect refRectA, refRectB; SDL_Rect refRectA, refRectB;
SDL_Rect rectA, rectB; SDL_Rect rectA, rectB;
@ -1462,7 +1463,7 @@ int rect_testUnionRectInside(void *arg)
* *
* \sa SDL_GetRectUnion * \sa SDL_GetRectUnion
*/ */
int rect_testUnionRectParam(void *arg) static int rect_testUnionRectParam(void *arg)
{ {
SDL_Rect rectA, rectB = { 0 }; SDL_Rect rectA, rectB = { 0 };
SDL_Rect result; SDL_Rect result;
@ -1489,7 +1490,7 @@ int rect_testUnionRectParam(void *arg)
* *
* \sa SDL_RectEmpty * \sa SDL_RectEmpty
*/ */
int rect_testRectEmpty(void *arg) static int rect_testRectEmpty(void *arg)
{ {
SDL_Rect refRect; SDL_Rect refRect;
SDL_Rect rect; SDL_Rect rect;
@ -1531,7 +1532,7 @@ int rect_testRectEmpty(void *arg)
* *
* \sa SDL_RectEmpty * \sa SDL_RectEmpty
*/ */
int rect_testRectEmptyParam(void *arg) static int rect_testRectEmptyParam(void *arg)
{ {
SDL_bool result; SDL_bool result;
@ -1547,7 +1548,7 @@ int rect_testRectEmptyParam(void *arg)
* *
* \sa SDL_RectsEqual * \sa SDL_RectsEqual
*/ */
int rect_testRectEquals(void *arg) static int rect_testRectEquals(void *arg)
{ {
SDL_Rect refRectA; SDL_Rect refRectA;
SDL_Rect refRectB; SDL_Rect refRectB;
@ -1576,7 +1577,7 @@ int rect_testRectEquals(void *arg)
* *
* \sa SDL_RectsEqual * \sa SDL_RectsEqual
*/ */
int rect_testRectEqualsParam(void *arg) static int rect_testRectEqualsParam(void *arg)
{ {
SDL_Rect rectA; SDL_Rect rectA;
SDL_Rect rectB; SDL_Rect rectB;
@ -1608,7 +1609,7 @@ int rect_testRectEqualsParam(void *arg)
* *
* \sa SDL_RectsEqualFloat * \sa SDL_RectsEqualFloat
*/ */
int rect_testFRectEquals(void *arg) static int rect_testFRectEquals(void *arg)
{ {
SDL_FRect refRectA; SDL_FRect refRectA;
SDL_FRect refRectB; SDL_FRect refRectB;
@ -1637,7 +1638,7 @@ int rect_testFRectEquals(void *arg)
* *
* \sa SDL_RectsEqualFloat * \sa SDL_RectsEqualFloat
*/ */
int rect_testFRectEqualsParam(void *arg) static int rect_testFRectEqualsParam(void *arg)
{ {
SDL_FRect rectA; SDL_FRect rectA;
SDL_FRect rectB; SDL_FRect rectB;

View file

@ -5,6 +5,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_images.h" #include "testautomation_images.h"
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -28,8 +29,8 @@
} }
/* Test window and renderer */ /* Test window and renderer */
SDL_Window *window = NULL; static SDL_Window *window = NULL;
SDL_Renderer *renderer = NULL; static SDL_Renderer *renderer = NULL;
/* Prototypes for helper functions */ /* Prototypes for helper functions */
@ -45,7 +46,7 @@ static int isSupported(int code);
/** /**
* Create software renderer for tests * Create software renderer for tests
*/ */
void InitCreateRenderer(void *arg) static void InitCreateRenderer(void *arg)
{ {
int width = 320, height = 240; int width = 320, height = 240;
renderer = NULL; renderer = NULL;
@ -68,7 +69,7 @@ void InitCreateRenderer(void *arg)
/** /**
* Destroy renderer for tests * Destroy renderer for tests
*/ */
void CleanupDestroyRenderer(void *arg) static void CleanupDestroyRenderer(void *arg)
{ {
if (renderer != NULL) { if (renderer != NULL) {
SDL_DestroyRenderer(renderer); SDL_DestroyRenderer(renderer);
@ -88,7 +89,7 @@ void CleanupDestroyRenderer(void *arg)
* *
* \sa SDL_GetNumRenderDrivers * \sa SDL_GetNumRenderDrivers
*/ */
int render_testGetNumRenderDrivers(void *arg) static int render_testGetNumRenderDrivers(void *arg)
{ {
int n; int n;
n = SDL_GetNumRenderDrivers(); n = SDL_GetNumRenderDrivers();
@ -104,7 +105,7 @@ int render_testGetNumRenderDrivers(void *arg)
* \sa SDL_RenderLine * \sa SDL_RenderLine
* *
*/ */
int render_testPrimitives(void *arg) static int render_testPrimitives(void *arg)
{ {
int ret; int ret;
int x, y; int x, y;
@ -190,7 +191,7 @@ int render_testPrimitives(void *arg)
* \sa SDL_SetRenderDrawBlendMode * \sa SDL_SetRenderDrawBlendMode
* \sa SDL_RenderFillRect * \sa SDL_RenderFillRect
*/ */
int render_testPrimitivesBlend(void *arg) static int render_testPrimitivesBlend(void *arg)
{ {
int ret; int ret;
int i, j; int i, j;
@ -332,7 +333,7 @@ int render_testPrimitivesBlend(void *arg)
* \sa SDL_RenderTexture * \sa SDL_RenderTexture
* \sa SDL_DestroyTexture * \sa SDL_DestroyTexture
*/ */
int render_testBlit(void *arg) static int render_testBlit(void *arg)
{ {
int ret; int ret;
SDL_FRect rect; SDL_FRect rect;
@ -400,7 +401,7 @@ int render_testBlit(void *arg)
* \sa SDL_RenderTexture * \sa SDL_RenderTexture
* \sa SDL_DestroyTexture * \sa SDL_DestroyTexture
*/ */
int render_testBlitColor(void *arg) static int render_testBlitColor(void *arg)
{ {
int ret; int ret;
SDL_FRect rect; SDL_FRect rect;
@ -474,7 +475,7 @@ int render_testBlitColor(void *arg)
* \sa SDL_RenderTexture * \sa SDL_RenderTexture
* \sa SDL_DestroyTexture * \sa SDL_DestroyTexture
*/ */
int render_testBlitAlpha(void *arg) static int render_testBlitAlpha(void *arg)
{ {
int ret; int ret;
SDL_FRect rect; SDL_FRect rect;
@ -603,7 +604,7 @@ testBlitBlendMode(SDL_Texture *tface, int mode)
* \sa SDL_SetTextureBlendMode * \sa SDL_SetTextureBlendMode
* \sa SDL_DestroyTexture * \sa SDL_DestroyTexture
*/ */
int render_testBlitBlend(void *arg) static int render_testBlitBlend(void *arg)
{ {
int ret; int ret;
SDL_FRect rect; SDL_FRect rect;
@ -755,7 +756,7 @@ int render_testBlitBlend(void *arg)
/** /**
* \brief Test viewport * \brief Test viewport
*/ */
int render_testViewport(void *arg) static int render_testViewport(void *arg)
{ {
SDL_Surface *referenceSurface; SDL_Surface *referenceSurface;
SDL_Rect viewport; SDL_Rect viewport;
@ -812,7 +813,7 @@ int render_testViewport(void *arg)
/** /**
* \brief Test logical size * \brief Test logical size
*/ */
int render_testLogicalSize(void *arg) static int render_testLogicalSize(void *arg)
{ {
SDL_Surface *referenceSurface; SDL_Surface *referenceSurface;
SDL_Rect viewport; SDL_Rect viewport;

View file

@ -18,12 +18,13 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
const char *RWopsReadTestFilename = "rwops_read"; static const char *RWopsReadTestFilename = "rwops_read";
const char *RWopsWriteTestFilename = "rwops_write"; static const char *RWopsWriteTestFilename = "rwops_write";
const char *RWopsAlphabetFilename = "rwops_alphabet"; static const char *RWopsAlphabetFilename = "rwops_alphabet";
static const char RWopsHelloWorldTestString[] = "Hello World!"; static const char RWopsHelloWorldTestString[] = "Hello World!";
static const char RWopsHelloWorldCompString[] = "Hello World!"; static const char RWopsHelloWorldCompString[] = "Hello World!";
@ -31,7 +32,7 @@ static const char RWopsAlphabetString[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/* Fixture */ /* Fixture */
void RWopsSetUp(void *arg) static void RWopsSetUp(void *arg)
{ {
size_t fileLen; size_t fileLen;
FILE *handle; FILE *handle;
@ -74,7 +75,7 @@ void RWopsSetUp(void *arg)
SDLTest_AssertPass("Creation of test file completed"); SDLTest_AssertPass("Creation of test file completed");
} }
void RWopsTearDown(void *arg) static void RWopsTearDown(void *arg)
{ {
int result; int result;
@ -172,7 +173,7 @@ static void testGenericRWopsValidations(SDL_RWops *rw, int write)
* \sa SDL_RWFromFile * \sa SDL_RWFromFile
* *
*/ */
int rwops_testParamNegative(void) static int rwops_testParamNegative(void *arg)
{ {
SDL_RWops *rwops; SDL_RWops *rwops;
@ -218,7 +219,7 @@ int rwops_testParamNegative(void)
* \sa SDL_RWFromMem * \sa SDL_RWFromMem
* \sa SDL_RWClose * \sa SDL_RWClose
*/ */
int rwops_testMem(void) static int rwops_testMem(void *arg)
{ {
char mem[sizeof(RWopsHelloWorldTestString)]; char mem[sizeof(RWopsHelloWorldTestString)];
SDL_RWops *rw; SDL_RWops *rw;
@ -257,7 +258,7 @@ int rwops_testMem(void)
* \sa SDL_RWFromConstMem * \sa SDL_RWFromConstMem
* \sa SDL_RWClose * \sa SDL_RWClose
*/ */
int rwops_testConstMem(void) static int rwops_testConstMem(void *arg)
{ {
SDL_RWops *rw; SDL_RWops *rw;
int result; int result;
@ -292,7 +293,7 @@ int rwops_testConstMem(void)
* \sa SDL_RWFromFile * \sa SDL_RWFromFile
* \sa SDL_RWClose * \sa SDL_RWClose
*/ */
int rwops_testFileRead(void) static int rwops_testFileRead(void *arg)
{ {
SDL_RWops *rw; SDL_RWops *rw;
int result; int result;
@ -339,7 +340,7 @@ int rwops_testFileRead(void)
* \sa SDL_RWFromFile * \sa SDL_RWFromFile
* \sa SDL_RWClose * \sa SDL_RWClose
*/ */
int rwops_testFileWrite(void) static int rwops_testFileWrite(void *arg)
{ {
SDL_RWops *rw; SDL_RWops *rw;
int result; int result;
@ -386,7 +387,7 @@ int rwops_testFileWrite(void)
* \sa SDL_CreateRW * \sa SDL_CreateRW
* \sa SDL_DestroyRW * \sa SDL_DestroyRW
*/ */
int rwops_testAllocFree(void) static int rwops_testAllocFree(void *arg)
{ {
/* Allocate context */ /* Allocate context */
SDL_RWops *rw = SDL_CreateRW(); SDL_RWops *rw = SDL_CreateRW();
@ -414,7 +415,7 @@ int rwops_testAllocFree(void)
* \sa SDL_RWFromMem * \sa SDL_RWFromMem
* \sa SDL_RWFromFile * \sa SDL_RWFromFile
*/ */
int rwops_testCompareRWFromMemWithRWFromFile(void) static int rwops_testCompareRWFromMemWithRWFromFile(void *arg)
{ {
int slen = 26; int slen = 26;
char buffer_file[27]; char buffer_file[27];
@ -479,7 +480,7 @@ int rwops_testCompareRWFromMemWithRWFromFile(void)
* \sa SDL_ReadBE16 * \sa SDL_ReadBE16
* \sa SDL_WriteBE16 * \sa SDL_WriteBE16
*/ */
int rwops_testFileWriteReadEndian(void) static int rwops_testFileWriteReadEndian(void *arg)
{ {
SDL_RWops *rw; SDL_RWops *rw;
Sint64 result; Sint64 result;

View file

@ -7,13 +7,14 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Test case functions */ /* Test case functions */
/** /**
* \brief Calls to SDLTest_GenerateRunSeed() * \brief Calls to SDLTest_GenerateRunSeed()
*/ */
int sdltest_generateRunSeed(void *arg) static int sdltest_generateRunSeed(void *arg)
{ {
char *result; char *result;
size_t i, l; size_t i, l;
@ -43,7 +44,7 @@ int sdltest_generateRunSeed(void *arg)
/** /**
* \brief Calls to SDLTest_GetFuzzerInvocationCount() * \brief Calls to SDLTest_GetFuzzerInvocationCount()
*/ */
int sdltest_getFuzzerInvocationCount(void *arg) static int sdltest_getFuzzerInvocationCount(void *arg)
{ {
Uint8 result; Uint8 result;
int fuzzerCount1, fuzzerCount2; int fuzzerCount1, fuzzerCount2;
@ -65,7 +66,7 @@ int sdltest_getFuzzerInvocationCount(void *arg)
/** /**
* \brief Calls to random number generators * \brief Calls to random number generators
*/ */
int sdltest_randomNumber(void *arg) static int sdltest_randomNumber(void *arg)
{ {
Sint64 result; Sint64 result;
double dresult; double dresult;
@ -132,7 +133,7 @@ int sdltest_randomNumber(void *arg)
/** /**
* \brief Calls to random boundary number generators for Uint8 * \brief Calls to random boundary number generators for Uint8
*/ */
int sdltest_randomBoundaryNumberUint8(void *arg) static int sdltest_randomBoundaryNumberUint8(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -241,7 +242,7 @@ int sdltest_randomBoundaryNumberUint8(void *arg)
/** /**
* \brief Calls to random boundary number generators for Uint16 * \brief Calls to random boundary number generators for Uint16
*/ */
int sdltest_randomBoundaryNumberUint16(void *arg) static int sdltest_randomBoundaryNumberUint16(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -350,7 +351,7 @@ int sdltest_randomBoundaryNumberUint16(void *arg)
/** /**
* \brief Calls to random boundary number generators for Uint32 * \brief Calls to random boundary number generators for Uint32
*/ */
int sdltest_randomBoundaryNumberUint32(void *arg) static int sdltest_randomBoundaryNumberUint32(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -459,7 +460,7 @@ int sdltest_randomBoundaryNumberUint32(void *arg)
/** /**
* \brief Calls to random boundary number generators for Uint64 * \brief Calls to random boundary number generators for Uint64
*/ */
int sdltest_randomBoundaryNumberUint64(void *arg) static int sdltest_randomBoundaryNumberUint64(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -568,7 +569,7 @@ int sdltest_randomBoundaryNumberUint64(void *arg)
/** /**
* \brief Calls to random boundary number generators for Sint8 * \brief Calls to random boundary number generators for Sint8
*/ */
int sdltest_randomBoundaryNumberSint8(void *arg) static int sdltest_randomBoundaryNumberSint8(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -677,7 +678,7 @@ int sdltest_randomBoundaryNumberSint8(void *arg)
/** /**
* \brief Calls to random boundary number generators for Sint16 * \brief Calls to random boundary number generators for Sint16
*/ */
int sdltest_randomBoundaryNumberSint16(void *arg) static int sdltest_randomBoundaryNumberSint16(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -786,7 +787,7 @@ int sdltest_randomBoundaryNumberSint16(void *arg)
/** /**
* \brief Calls to random boundary number generators for Sint32 * \brief Calls to random boundary number generators for Sint32
*/ */
int sdltest_randomBoundaryNumberSint32(void *arg) static int sdltest_randomBoundaryNumberSint32(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -902,7 +903,7 @@ int sdltest_randomBoundaryNumberSint32(void *arg)
/** /**
* \brief Calls to random boundary number generators for Sint64 * \brief Calls to random boundary number generators for Sint64
*/ */
int sdltest_randomBoundaryNumberSint64(void *arg) static int sdltest_randomBoundaryNumberSint64(void *arg)
{ {
const char *expectedError = "That operation is not supported"; const char *expectedError = "That operation is not supported";
char *lastError; char *lastError;
@ -1011,7 +1012,7 @@ int sdltest_randomBoundaryNumberSint64(void *arg)
/** /**
* \brief Calls to SDLTest_RandomIntegerInRange * \brief Calls to SDLTest_RandomIntegerInRange
*/ */
int sdltest_randomIntegerInRange(void *arg) static int sdltest_randomIntegerInRange(void *arg)
{ {
Sint32 min, max; Sint32 min, max;
Sint32 result; Sint32 result;
@ -1085,7 +1086,7 @@ int sdltest_randomIntegerInRange(void *arg)
/** /**
* \brief Calls to SDLTest_RandomAsciiString * \brief Calls to SDLTest_RandomAsciiString
*/ */
int sdltest_randomAsciiString(void *arg) static int sdltest_randomAsciiString(void *arg)
{ {
char *result; char *result;
size_t len; size_t len;
@ -1117,7 +1118,7 @@ int sdltest_randomAsciiString(void *arg)
/** /**
* \brief Calls to SDLTest_RandomAsciiStringWithMaximumLength * \brief Calls to SDLTest_RandomAsciiStringWithMaximumLength
*/ */
int sdltest_randomAsciiStringWithMaximumLength(void *arg) static int sdltest_randomAsciiStringWithMaximumLength(void *arg)
{ {
const char *expectedError = "Parameter 'maxLength' is invalid"; const char *expectedError = "Parameter 'maxLength' is invalid";
char *lastError; char *lastError;
@ -1169,7 +1170,7 @@ int sdltest_randomAsciiStringWithMaximumLength(void *arg)
/** /**
* \brief Calls to SDLTest_RandomAsciiStringOfSize * \brief Calls to SDLTest_RandomAsciiStringOfSize
*/ */
int sdltest_randomAsciiStringOfSize(void *arg) static int sdltest_randomAsciiStringOfSize(void *arg)
{ {
const char *expectedError = "Parameter 'size' is invalid"; const char *expectedError = "Parameter 'size' is invalid";
char *lastError; char *lastError;

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Test case functions */ /* Test case functions */
@ -10,7 +11,7 @@
* \brief Call to SDL_strlcpy * \brief Call to SDL_strlcpy
*/ */
#undef SDL_strlcpy #undef SDL_strlcpy
int stdlib_strlcpy(void *arg) static int stdlib_strlcpy(void *arg)
{ {
size_t result; size_t result;
char text[1024]; char text[1024];
@ -45,7 +46,7 @@ int stdlib_strlcpy(void *arg)
* \brief Call to SDL_snprintf * \brief Call to SDL_snprintf
*/ */
#undef SDL_snprintf #undef SDL_snprintf
int stdlib_snprintf(void *arg) static int stdlib_snprintf(void *arg)
{ {
int result; int result;
int predicted; int predicted;
@ -211,7 +212,7 @@ int stdlib_snprintf(void *arg)
/** /**
* \brief Call to SDL_getenv and SDL_setenv * \brief Call to SDL_getenv and SDL_setenv
*/ */
int stdlib_getsetenv(void *arg) static int stdlib_getsetenv(void *arg)
{ {
const int nameLen = 16; const int nameLen = 16;
char name[17]; char name[17];
@ -355,7 +356,7 @@ int stdlib_getsetenv(void *arg)
* \brief Call to SDL_sscanf * \brief Call to SDL_sscanf
*/ */
#undef SDL_sscanf #undef SDL_sscanf
int stdlib_sscanf(void *arg) static int stdlib_sscanf(void *arg)
{ {
int output; int output;
int result; int result;
@ -447,7 +448,7 @@ int stdlib_sscanf(void *arg)
/** /**
* \brief Call to SDL_aligned_alloc * \brief Call to SDL_aligned_alloc
*/ */
int stdlib_aligned_alloc(void *arg) static int stdlib_aligned_alloc(void *arg)
{ {
size_t i, alignment; size_t i, alignment;
void *ptr; void *ptr;

View file

@ -19,6 +19,7 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
#include "testautomation_images.h" #include "testautomation_images.h"
/* ================= Test Case Implementation ================== */ /* ================= Test Case Implementation ================== */
@ -28,11 +29,6 @@
static SDL_Surface *referenceSurface = NULL; static SDL_Surface *referenceSurface = NULL;
static SDL_Surface *testSurface = NULL; static SDL_Surface *testSurface = NULL;
/* Helper functions for the test cases */
#define TEST_SURFACE_WIDTH testSurface->w
#define TEST_SURFACE_HEIGHT testSurface->h
/* Fixture */ /* Fixture */
/* Create a 32-bit writable surface for blitting tests */ /* Create a 32-bit writable surface for blitting tests */
@ -66,7 +62,7 @@ static void surfaceTearDown(void *arg)
/** /**
* Helper that clears the test surface * Helper that clears the test surface
*/ */
static void clearTestSurface() static void clearTestSurface(void)
{ {
int ret; int ret;
Uint32 color; Uint32 color;
@ -215,7 +211,7 @@ static void AssertFileExist(const char *filename)
/** /**
* \brief Tests sprite saving and loading * \brief Tests sprite saving and loading
*/ */
int surface_testSaveLoadBitmap(void *arg) static int surface_testSaveLoadBitmap(void *arg)
{ {
int ret; int ret;
const char *sampleFilename = "testSaveLoadBitmap.bmp"; const char *sampleFilename = "testSaveLoadBitmap.bmp";
@ -262,7 +258,7 @@ int surface_testSaveLoadBitmap(void *arg)
/** /**
* Tests surface conversion. * Tests surface conversion.
*/ */
int surface_testSurfaceConversion(void *arg) static int surface_testSurfaceConversion(void *arg)
{ {
SDL_Surface *rface = NULL, *face = NULL; SDL_Surface *rface = NULL, *face = NULL;
int ret = 0; int ret = 0;
@ -302,7 +298,7 @@ int surface_testSurfaceConversion(void *arg)
/** /**
* Tests surface conversion across all pixel formats. * Tests surface conversion across all pixel formats.
*/ */
int surface_testCompleteSurfaceConversion(void *arg) static int surface_testCompleteSurfaceConversion(void *arg)
{ {
Uint32 pixel_formats[] = { Uint32 pixel_formats[] = {
SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_INDEX8,
@ -392,7 +388,7 @@ int surface_testCompleteSurfaceConversion(void *arg)
/** /**
* \brief Tests sprite loading. A failure case. * \brief Tests sprite loading. A failure case.
*/ */
int surface_testLoadFailure(void *arg) static int surface_testLoadFailure(void *arg)
{ {
SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp"); SDL_Surface *face = SDL_LoadBMP("nonexistant.bmp");
SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp"); SDLTest_AssertCheck(face == NULL, "SDL_CreateLoadBmp");
@ -403,7 +399,7 @@ int surface_testLoadFailure(void *arg)
/** /**
* \brief Tests some blitting routines. * \brief Tests some blitting routines.
*/ */
int surface_testBlit(void *arg) static int surface_testBlit(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -425,7 +421,7 @@ int surface_testBlit(void *arg)
/** /**
* \brief Tests some blitting routines with color mod * \brief Tests some blitting routines with color mod
*/ */
int surface_testBlitColorMod(void *arg) static int surface_testBlitColorMod(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -447,7 +443,7 @@ int surface_testBlitColorMod(void *arg)
/** /**
* \brief Tests some blitting routines with alpha mod * \brief Tests some blitting routines with alpha mod
*/ */
int surface_testBlitAlphaMod(void *arg) static int surface_testBlitAlphaMod(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -469,7 +465,7 @@ int surface_testBlitAlphaMod(void *arg)
/** /**
* \brief Tests some more blitting routines. * \brief Tests some more blitting routines.
*/ */
int surface_testBlitBlendNone(void *arg) static int surface_testBlitBlendNone(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -491,7 +487,7 @@ int surface_testBlitBlendNone(void *arg)
/** /**
* \brief Tests some more blitting routines. * \brief Tests some more blitting routines.
*/ */
int surface_testBlitBlendBlend(void *arg) static int surface_testBlitBlendBlend(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -513,7 +509,7 @@ int surface_testBlitBlendBlend(void *arg)
/** /**
* \brief Tests some more blitting routines. * \brief Tests some more blitting routines.
*/ */
int surface_testBlitBlendAdd(void *arg) static int surface_testBlitBlendAdd(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -535,7 +531,7 @@ int surface_testBlitBlendAdd(void *arg)
/** /**
* \brief Tests some more blitting routines. * \brief Tests some more blitting routines.
*/ */
int surface_testBlitBlendMod(void *arg) static int surface_testBlitBlendMod(void *arg)
{ {
int ret; int ret;
SDL_Surface *compareSurface; SDL_Surface *compareSurface;
@ -557,7 +553,7 @@ int surface_testBlitBlendMod(void *arg)
/** /**
* \brief Tests some more blitting routines with loop * \brief Tests some more blitting routines with loop
*/ */
int surface_testBlitBlendLoop(void *arg) static int surface_testBlitBlendLoop(void *arg)
{ {
int ret; int ret;
@ -577,7 +573,7 @@ int surface_testBlitBlendLoop(void *arg)
return TEST_COMPLETED; return TEST_COMPLETED;
} }
int surface_testOverflow(void *arg) static int surface_testOverflow(void *arg)
{ {
char buf[1024]; char buf[1024];
const char *expectedError; const char *expectedError;

View file

@ -4,13 +4,14 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_syswm.h> #include <SDL3/SDL_syswm.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Test case functions */ /* Test case functions */
/** /**
* \brief Call to SDL_GetWindowWMInfo * \brief Call to SDL_GetWindowWMInfo
*/ */
int syswm_getWindowWMInfo(void *arg) static int syswm_getWindowWMInfo(void *arg)
{ {
int result; int result;
SDL_Window *window; SDL_Window *window;

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Flag indicating if the param should be checked */ /* Flag indicating if the param should be checked */
static int g_paramCheck = 0; static int g_paramCheck = 0;
@ -31,7 +32,7 @@ static void timerSetUp(void *arg)
/** /**
* \brief Call to SDL_GetPerformanceCounter * \brief Call to SDL_GetPerformanceCounter
*/ */
int timer_getPerformanceCounter(void *arg) static int timer_getPerformanceCounter(void *arg)
{ {
Uint64 result; Uint64 result;
@ -45,7 +46,7 @@ int timer_getPerformanceCounter(void *arg)
/** /**
* \brief Call to SDL_GetPerformanceFrequency * \brief Call to SDL_GetPerformanceFrequency
*/ */
int timer_getPerformanceFrequency(void *arg) static int timer_getPerformanceFrequency(void *arg)
{ {
Uint64 result; Uint64 result;
@ -59,7 +60,7 @@ int timer_getPerformanceFrequency(void *arg)
/** /**
* \brief Call to SDL_Delay and SDL_GetTicks * \brief Call to SDL_Delay and SDL_GetTicks
*/ */
int timer_delayAndGetTicks(void *arg) static int timer_delayAndGetTicks(void *arg)
{ {
const int testDelay = 100; const int testDelay = 100;
const int marginOfError = 25; const int marginOfError = 25;
@ -114,7 +115,7 @@ static Uint32 SDLCALL timerTestCallback(Uint32 interval, void *param)
/** /**
* \brief Call to SDL_AddTimer and SDL_RemoveTimer * \brief Call to SDL_AddTimer and SDL_RemoveTimer
*/ */
int timer_addRemoveTimer(void *arg) static int timer_addRemoveTimer(void *arg)
{ {
SDL_TimerID id; SDL_TimerID id;
SDL_bool result; SDL_bool result;

View file

@ -3,6 +3,7 @@
*/ */
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_test.h> #include <SDL3/SDL_test.h>
#include "testautomation_suites.h"
/* Private helpers */ /* Private helpers */
@ -44,7 +45,7 @@ static void destroyVideoSuiteTestWindow(SDL_Window *window)
/** /**
* \brief Enable and disable screensaver while checking state * \brief Enable and disable screensaver while checking state
*/ */
int video_enableDisableScreensaver(void *arg) static int video_enableDisableScreensaver(void *arg)
{ {
SDL_bool initialResult; SDL_bool initialResult;
SDL_bool result; SDL_bool result;
@ -95,11 +96,11 @@ int video_enableDisableScreensaver(void *arg)
/** /**
* \brief Tests the functionality of the SDL_CreateWindow function using different sizes * \brief Tests the functionality of the SDL_CreateWindow function using different sizes
*/ */
int video_createWindowVariousSizes(void *arg) static int video_createWindowVariousSizes(void *arg)
{ {
SDL_Window *window; SDL_Window *window;
const char *title = "video_createWindowVariousSizes Test Window"; const char *title = "video_createWindowVariousSizes Test Window";
int w, h; int w = 0, h = 0;
int wVariation, hVariation; int wVariation, hVariation;
for (wVariation = 0; wVariation < 3; wVariation++) { for (wVariation = 0; wVariation < 3; wVariation++) {
@ -149,7 +150,7 @@ int video_createWindowVariousSizes(void *arg)
/** /**
* \brief Tests the functionality of the SDL_CreateWindow function using different flags * \brief Tests the functionality of the SDL_CreateWindow function using different flags
*/ */
int video_createWindowVariousFlags(void *arg) static int video_createWindowVariousFlags(void *arg)
{ {
SDL_Window *window; SDL_Window *window;
const char *title = "video_createWindowVariousFlags Test Window"; const char *title = "video_createWindowVariousFlags Test Window";
@ -221,7 +222,7 @@ int video_createWindowVariousFlags(void *arg)
/** /**
* \brief Tests the functionality of the SDL_GetWindowFlags function * \brief Tests the functionality of the SDL_GetWindowFlags function
*/ */
int video_getWindowFlags(void *arg) static int video_getWindowFlags(void *arg)
{ {
SDL_Window *window; SDL_Window *window;
const char *title = "video_getWindowFlags Test Window"; const char *title = "video_getWindowFlags Test Window";
@ -248,7 +249,7 @@ int video_getWindowFlags(void *arg)
/** /**
* \brief Tests the functionality of the SDL_GetFullscreenDisplayModes function * \brief Tests the functionality of the SDL_GetFullscreenDisplayModes function
*/ */
int video_getFullscreenDisplayModes(void *arg) static int video_getFullscreenDisplayModes(void *arg)
{ {
SDL_DisplayID *displays; SDL_DisplayID *displays;
const SDL_DisplayMode **modes; const SDL_DisplayMode **modes;
@ -277,7 +278,7 @@ int video_getFullscreenDisplayModes(void *arg)
/** /**
* \brief Tests the functionality of the SDL_GetClosestFullscreenDisplayMode function against current resolution * \brief Tests the functionality of the SDL_GetClosestFullscreenDisplayMode function against current resolution
*/ */
int video_getClosestDisplayModeCurrentResolution(void *arg) static int video_getClosestDisplayModeCurrentResolution(void *arg)
{ {
SDL_DisplayID *displays; SDL_DisplayID *displays;
const SDL_DisplayMode **modes; const SDL_DisplayMode **modes;
@ -322,7 +323,7 @@ int video_getClosestDisplayModeCurrentResolution(void *arg)
/** /**
* \brief Tests the functionality of the SDL_GetClosestFullscreenDisplayMode function against random resolution * \brief Tests the functionality of the SDL_GetClosestFullscreenDisplayMode function against random resolution
*/ */
int video_getClosestDisplayModeRandomResolution(void *arg) static int video_getClosestDisplayModeRandomResolution(void *arg)
{ {
SDL_DisplayID *displays; SDL_DisplayID *displays;
SDL_DisplayMode target; SDL_DisplayMode target;
@ -362,7 +363,7 @@ int video_getClosestDisplayModeRandomResolution(void *arg)
* *
* \sa SDL_GetWindowFullscreenMode * \sa SDL_GetWindowFullscreenMode
*/ */
int video_getWindowDisplayMode(void *arg) static int video_getWindowDisplayMode(void *arg)
{ {
SDL_Window *window; SDL_Window *window;
const char *title = "video_getWindowDisplayMode Test Window"; const char *title = "video_getWindowDisplayMode Test Window";
@ -383,7 +384,7 @@ int video_getWindowDisplayMode(void *arg)
} }
/* Helper function that checks for an 'Invalid window' error */ /* Helper function that checks for an 'Invalid window' error */
static void checkInvalidWindowError() static void checkInvalidWindowError(void)
{ {
const char *invalidWindowError = "Invalid window"; const char *invalidWindowError = "Invalid window";
char *lastError; char *lastError;
@ -406,7 +407,7 @@ static void checkInvalidWindowError()
* *
* \sa SDL_GetWindowFullscreenMode * \sa SDL_GetWindowFullscreenMode
*/ */
int video_getWindowDisplayModeNegative(void *arg) static int video_getWindowDisplayModeNegative(void *arg)
{ {
const SDL_DisplayMode *mode; const SDL_DisplayMode *mode;
@ -495,7 +496,7 @@ static void setAndCheckWindowKeyboardGrabState(SDL_Window *window, SDL_bool desi
* \sa SDL_GetWindowGrab * \sa SDL_GetWindowGrab
* \sa SDL_SetWindowGrab * \sa SDL_SetWindowGrab
*/ */
int video_getSetWindowGrab(void *arg) static int video_getSetWindowGrab(void *arg)
{ {
const char *title = "video_getSetWindowGrab Test Window"; const char *title = "video_getSetWindowGrab Test Window";
SDL_Window *window; SDL_Window *window;
@ -638,7 +639,7 @@ int video_getSetWindowGrab(void *arg)
* \sa SDL_GetWindowID * \sa SDL_GetWindowID
* \sa SDL_SetWindowFromID * \sa SDL_SetWindowFromID
*/ */
int video_getWindowId(void *arg) static int video_getWindowId(void *arg)
{ {
const char *title = "video_getWindowId Test Window"; const char *title = "video_getWindowId Test Window";
SDL_Window *window; SDL_Window *window;
@ -694,7 +695,7 @@ int video_getWindowId(void *arg)
* *
* \sa SDL_GetWindowPixelFormat * \sa SDL_GetWindowPixelFormat
*/ */
int video_getWindowPixelFormat(void *arg) static int video_getWindowPixelFormat(void *arg)
{ {
const char *title = "video_getWindowPixelFormat Test Window"; const char *title = "video_getWindowPixelFormat Test Window";
SDL_Window *window; SDL_Window *window;
@ -730,7 +731,7 @@ int video_getWindowPixelFormat(void *arg)
* \sa SDL_GetWindowPosition * \sa SDL_GetWindowPosition
* \sa SDL_SetWindowPosition * \sa SDL_SetWindowPosition
*/ */
int video_getSetWindowPosition(void *arg) static int video_getSetWindowPosition(void *arg)
{ {
const char *title = "video_getSetWindowPosition Test Window"; const char *title = "video_getSetWindowPosition Test Window";
SDL_Window *window; SDL_Window *window;
@ -852,7 +853,7 @@ int video_getSetWindowPosition(void *arg)
} }
/* Helper function that checks for an 'Invalid parameter' error */ /* Helper function that checks for an 'Invalid parameter' error */
static void checkInvalidParameterError() static void checkInvalidParameterError(void)
{ {
const char *invalidParameterError = "Parameter"; const char *invalidParameterError = "Parameter";
char *lastError; char *lastError;
@ -876,7 +877,7 @@ static void checkInvalidParameterError()
* \sa SDL_GetWindowSize * \sa SDL_GetWindowSize
* \sa SDL_SetWindowSize * \sa SDL_SetWindowSize
*/ */
int video_getSetWindowSize(void *arg) static int video_getSetWindowSize(void *arg)
{ {
const char *title = "video_getSetWindowSize Test Window"; const char *title = "video_getSetWindowSize Test Window";
SDL_Window *window; SDL_Window *window;
@ -1043,7 +1044,7 @@ int video_getSetWindowSize(void *arg)
* \brief Tests call to SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize * \brief Tests call to SDL_GetWindowMinimumSize and SDL_SetWindowMinimumSize
* *
*/ */
int video_getSetWindowMinimumSize(void *arg) static int video_getSetWindowMinimumSize(void *arg)
{ {
const char *title = "video_getSetWindowMinimumSize Test Window"; const char *title = "video_getSetWindowMinimumSize Test Window";
SDL_Window *window; SDL_Window *window;
@ -1186,7 +1187,7 @@ int video_getSetWindowMinimumSize(void *arg)
* \brief Tests call to SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize * \brief Tests call to SDL_GetWindowMaximumSize and SDL_SetWindowMaximumSize
* *
*/ */
int video_getSetWindowMaximumSize(void *arg) static int video_getSetWindowMaximumSize(void *arg)
{ {
const char *title = "video_getSetWindowMaximumSize Test Window"; const char *title = "video_getSetWindowMaximumSize Test Window";
SDL_Window *window; SDL_Window *window;
@ -1195,7 +1196,7 @@ int video_getSetWindowMaximumSize(void *arg)
int wVariation, hVariation; int wVariation, hVariation;
int referenceW, referenceH; int referenceW, referenceH;
int currentW, currentH; int currentW, currentH;
int desiredW, desiredH; int desiredW = 0, desiredH = 0;
/* Get display bounds for size range */ /* Get display bounds for size range */
result = SDL_GetDisplayBounds(SDL_GetPrimaryDisplay(), &display); result = SDL_GetDisplayBounds(SDL_GetPrimaryDisplay(), &display);
@ -1326,7 +1327,7 @@ int video_getSetWindowMaximumSize(void *arg)
* \sa SDL_SetWindowData * \sa SDL_SetWindowData
* \sa SDL_GetWindowData * \sa SDL_GetWindowData
*/ */
int video_getSetWindowData(void *arg) static int video_getSetWindowData(void *arg)
{ {
int returnValue = TEST_COMPLETED; int returnValue = TEST_COMPLETED;
const char *title = "video_setGetWindowData Test Window"; const char *title = "video_setGetWindowData Test Window";
@ -1542,7 +1543,7 @@ cleanup:
* Espeically useful when run on a multi-monitor system with different DPI scales per monitor, * Espeically useful when run on a multi-monitor system with different DPI scales per monitor,
* to test that the window size is maintained when moving between monitors. * to test that the window size is maintained when moving between monitors.
*/ */
int video_setWindowCenteredOnDisplay(void *arg) static int video_setWindowCenteredOnDisplay(void *arg)
{ {
SDL_DisplayID *displays; SDL_DisplayID *displays;
SDL_Window *window; SDL_Window *window;

View file

@ -27,7 +27,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
int SDLCALL static int SDLCALL
ThreadFunc(void *data) ThreadFunc(void *data)
{ {
/* Set the child thread error string */ /* Set the child thread error string */

View file

@ -58,8 +58,7 @@ static int LoadContext(GL_Context *data)
} }
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void static void quit(int rc)
quit(int rc)
{ {
if (context) { if (context) {
/* SDL_GL_MakeCurrent(0, NULL); */ /* doesn't do anything */ /* SDL_GL_MakeCurrent(0, NULL); */ /* doesn't do anything */
@ -69,8 +68,7 @@ quit(int rc)
exit(rc); exit(rc);
} }
static void static void Render(void)
Render()
{ {
static float color[8][3] = { static float color[8][3] = {
{ 1.0, 1.0, 0.0 }, { 1.0, 1.0, 0.0 },

View file

@ -262,7 +262,7 @@ link_program(struct shader_data *data)
/* 3D data. Vertex range -0.5..0.5 in all axes. /* 3D data. Vertex range -0.5..0.5 in all axes.
* Z -0.5 is near, 0.5 is far. */ * Z -0.5 is near, 0.5 is far. */
const float g_vertices[] = { static const float g_vertices[] = {
/* Front face. */ /* Front face. */
/* Bottom left */ /* Bottom left */
-0.5, -0.5,
@ -391,7 +391,7 @@ const float g_vertices[] = {
0.5, 0.5,
}; };
const float g_colors[] = { static const float g_colors[] = {
/* Front face */ /* Front face */
/* Bottom left */ /* Bottom left */
1.0, 0.0, 0.0, /* red */ 1.0, 0.0, 0.0, /* red */
@ -448,7 +448,7 @@ const float g_colors[] = {
1.0, 0.0, 1.0, /* magenta */ 1.0, 0.0, 1.0, /* magenta */
}; };
const char *g_shader_vert_src = static const char *g_shader_vert_src =
" attribute vec4 av4position; " " attribute vec4 av4position; "
" attribute vec3 av3color; " " attribute vec3 av3color; "
" uniform mat4 mvp; " " uniform mat4 mvp; "
@ -458,7 +458,7 @@ const char *g_shader_vert_src =
" gl_Position = mvp * av4position; " " gl_Position = mvp * av4position; "
" } "; " } ";
const char *g_shader_frag_src = static const char *g_shader_frag_src =
" precision lowp float; " " precision lowp float; "
" varying vec3 vv3color; " " varying vec3 vv3color; "
" void main() { " " void main() { "
@ -519,10 +519,10 @@ Render(unsigned int width, unsigned int height, shader_data *data)
GL_CHECK(ctx.glDrawArrays(GL_TRIANGLES, 0, 36)); GL_CHECK(ctx.glDrawArrays(GL_TRIANGLES, 0, 36));
} }
int done; static int done;
Uint32 frames; static Uint32 frames;
shader_data *datas; static shader_data *datas;
thread_data *threads; static thread_data *threads;
static void static void
render_window(int index) render_window(int index)
@ -560,7 +560,7 @@ render_thread_fn(void *render_ctx)
} }
static void static void
loop_threaded() loop_threaded(void)
{ {
SDL_Event event; SDL_Event event;
int i; int i;
@ -589,7 +589,7 @@ loop_threaded()
#endif #endif
static void static void
loop() loop(void)
{ {
SDL_Event event; SDL_Event event;
int i; int i;

View file

@ -16,12 +16,12 @@
#define RESIZE_BORDER 20 #define RESIZE_BORDER 20
const SDL_Rect drag_areas[] = { static const SDL_Rect drag_areas[] = {
{ 20, 20, 100, 100 }, { 20, 20, 100, 100 },
{ 200, 70, 100, 100 }, { 200, 70, 100, 100 },
{ 400, 90, 100, 100 } { 400, 90, 100, 100 }
}; };
const SDL_FRect render_areas[] = { static const SDL_FRect render_areas[] = {
{ 20.0f, 20.0f, 100.0f, 100.0f }, { 20.0f, 20.0f, 100.0f, 100.0f },
{ 200.0f, 70.0f, 100.0f, 100.0f }, { 200.0f, 70.0f, 100.0f, 100.0f },
{ 400.0f, 90.0f, 100.0f, 100.0f } { 400.0f, 90.0f, 100.0f, 100.0f }

View file

@ -35,18 +35,18 @@ SDL_Quit_Wrapper(void)
SDL_Quit(); SDL_Quit();
} }
void printid(void) static void printid(void)
{ {
SDL_Log("Process %lu: exiting\n", SDL_ThreadID()); SDL_Log("Process %lu: exiting\n", SDL_ThreadID());
} }
void terminate(int sig) static void terminate(int sig)
{ {
(void)signal(SIGINT, terminate); (void)signal(SIGINT, terminate);
SDL_AtomicSet(&doterminate, 1); SDL_AtomicSet(&doterminate, 1);
} }
void closemutex(int sig) static void closemutex(int sig)
{ {
SDL_threadID id = SDL_ThreadID(); SDL_threadID id = SDL_ThreadID();
int i; int i;
@ -59,7 +59,7 @@ void closemutex(int sig)
exit(sig); exit(sig);
} }
int SDLCALL static int SDLCALL
Run(void *data) Run(void *data)
{ {
if (SDL_ThreadID() == mainthread) { if (SDL_ThreadID() == mainthread) {

View file

@ -43,7 +43,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_MIN_SINT64, SDL_MIN_SINT64 == ~0x7fffffffffffffffll)
SDL_COMPILE_TIME_ASSERT(SDL_MAX_UINT64, SDL_MAX_UINT64 == 18446744073709551615ull); SDL_COMPILE_TIME_ASSERT(SDL_MAX_UINT64, SDL_MAX_UINT64 == 18446744073709551615ull);
SDL_COMPILE_TIME_ASSERT(SDL_MIN_UINT64, SDL_MIN_UINT64 == 0); SDL_COMPILE_TIME_ASSERT(SDL_MIN_UINT64, SDL_MIN_UINT64 == 0);
int TestTypes(SDL_bool verbose) static int TestTypes(SDL_bool verbose)
{ {
int error = 0; int error = 0;
@ -78,7 +78,7 @@ int TestTypes(SDL_bool verbose)
return error ? 1 : 0; return error ? 1 : 0;
} }
int TestEndian(SDL_bool verbose) static int TestEndian(SDL_bool verbose)
{ {
int error = 0; int error = 0;
Uint16 value = 0x1234; Uint16 value = 0x1234;
@ -356,10 +356,10 @@ static LL_Test LL_Tests[] = {
{ "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll }, { "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x0000FFFFFFFFFFFEll, 0, 0x0000FFFF0000FFEEll },
{ "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll }, { "_uallrem", &TST_uallrem, 0x7FFFFFFEFFFFFFF0ll, 0x7FFFFFFEFFFFFFF0ll, 0, 0x0000000000000000ll },
{ NULL } { NULL, NULL, 0, 0, 0, 0 }
}; };
int Test64Bit(SDL_bool verbose) static int Test64Bit(SDL_bool verbose)
{ {
LL_Test *t; LL_Test *t;
int failed = 0; int failed = 0;
@ -385,7 +385,7 @@ int Test64Bit(SDL_bool verbose)
return failed ? 1 : 0; return failed ? 1 : 0;
} }
int TestCPUInfo(SDL_bool verbose) static int TestCPUInfo(SDL_bool verbose)
{ {
if (verbose) { if (verbose) {
SDL_Log("CPU count: %d\n", SDL_GetCPUCount()); SDL_Log("CPU count: %d\n", SDL_GetCPUCount());
@ -410,7 +410,7 @@ int TestCPUInfo(SDL_bool verbose)
return 0; return 0;
} }
int TestAssertions(SDL_bool verbose) static int TestAssertions(SDL_bool verbose)
{ {
SDL_assert(1); SDL_assert(1);
SDL_assert_release(1); SDL_assert_release(1);

View file

@ -28,8 +28,7 @@ static float mouseX, mouseY;
static SDL_FRect rect; static SDL_FRect rect;
static SDL_Event event; static SDL_Event event;
static void static void DrawRects(SDL_Renderer *renderer)
DrawRects(SDL_Renderer *renderer)
{ {
SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255); SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
rect.x = mouseX; rect.x = mouseX;
@ -37,8 +36,7 @@ DrawRects(SDL_Renderer *renderer)
SDL_RenderFillRect(renderer, &rect); SDL_RenderFillRect(renderer, &rect);
} }
static void static void loop(void)
loop()
{ {
/* Check for events */ /* Check for events */
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {

View file

@ -26,7 +26,7 @@ static int active_channel;
#define LFE_SINE_FREQ_HZ 50 #define LFE_SINE_FREQ_HZ 50
/* The channel layout is defined in SDL_audio.h */ /* The channel layout is defined in SDL_audio.h */
const char * static const char *
get_channel_name(int channel_index, int channel_count) get_channel_name(int channel_index, int channel_count)
{ {
switch (channel_index) { switch (channel_index) {
@ -84,14 +84,12 @@ get_channel_name(int channel_index, int channel_count)
return NULL; return NULL;
} }
SDL_bool static SDL_bool is_lfe_channel(int channel_index, int channel_count)
is_lfe_channel(int channel_index, int channel_count)
{ {
return (channel_count == 3 && channel_index == 2) || (channel_count >= 6 && channel_index == 3); return (channel_count == 3 && channel_index == 2) || (channel_count >= 6 && channel_index == 3);
} }
void SDLCALL static void SDLCALL fill_buffer(void *unused, Uint8 *stream, int len)
fill_buffer(void *unused, Uint8 *stream, int len)
{ {
Sint16 *buffer = (Sint16 *)stream; Sint16 *buffer = (Sint16 *)stream;
int samples = len / sizeof(Sint16); int samples = len / sizeof(Sint16);

View file

@ -47,7 +47,7 @@ getprioritystr(SDL_ThreadPriority priority)
return "???"; return "???";
} }
int SDLCALL static int SDLCALL
ThreadFunc(void *data) ThreadFunc(void *data)
{ {
SDL_ThreadPriority prio = SDL_THREAD_PRIORITY_NORMAL; SDL_ThreadPriority prio = SDL_THREAD_PRIORITY_NORMAL;