mirror of
https://github.com/love2d/megasource.git
synced 2026-08-20 04:30:45 +02:00
update SDL3 to latest commit
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
/* Fixture */
|
||||
|
||||
static void subsystemsSetUp(void *arg)
|
||||
static void SDLCALL subsystemsSetUp(void **arg)
|
||||
{
|
||||
/* Reset each one of the SDL subsystems */
|
||||
/* CHECKME: can we use SDL_Quit here, or this will break the flow of tests? */
|
||||
@@ -23,7 +23,7 @@ static void subsystemsSetUp(void *arg)
|
||||
SDLTest_AssertCheck(SDL_WasInit(0) == 0, "Check result from SDL_WasInit(0)");
|
||||
}
|
||||
|
||||
static void subsystemsTearDown(void *arg)
|
||||
static void SDLCALL subsystemsTearDown(void *arg)
|
||||
{
|
||||
/* Reset each one of the SDL subsystems */
|
||||
SDL_Quit();
|
||||
@@ -40,7 +40,7 @@ static void subsystemsTearDown(void *arg)
|
||||
* \sa SDL_QuitSubSystem
|
||||
*
|
||||
*/
|
||||
static int subsystems_referenceCount()
|
||||
static int SDLCALL subsystems_referenceCount(void *arg)
|
||||
{
|
||||
const int system = SDL_INIT_VIDEO;
|
||||
int result;
|
||||
@@ -90,7 +90,7 @@ static int subsystems_referenceCount()
|
||||
* \sa SDL_QuitSubSystem
|
||||
*
|
||||
*/
|
||||
static int subsystems_dependRefCountInitAllQuitByOne()
|
||||
static int SDLCALL subsystems_dependRefCountInitAllQuitByOne(void *arg)
|
||||
{
|
||||
int result;
|
||||
/* Ensure that we start with reset subsystems. */
|
||||
@@ -100,6 +100,8 @@ static int subsystems_dependRefCountInitAllQuitByOne()
|
||||
/* Following should init SDL_INIT_EVENTS and give it +3 ref counts. */
|
||||
SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK)");
|
||||
result = SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
||||
SDLTest_AssertCheck(result == (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), "Check result from SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), expected: 0x%x, got: 0x%x", (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK), result);
|
||||
result = SDL_WasInit(SDL_INIT_EVENTS);
|
||||
SDLTest_AssertCheck(result == SDL_INIT_EVENTS, "Check result from SDL_WasInit(SDL_INIT_EVENTS), expected: 0x4000, got: 0x%x", result);
|
||||
|
||||
@@ -128,7 +130,7 @@ static int subsystems_dependRefCountInitAllQuitByOne()
|
||||
* \sa SDL_QuitSubSystem
|
||||
*
|
||||
*/
|
||||
static int subsystems_dependRefCountInitByOneQuitAll()
|
||||
static int SDLCALL subsystems_dependRefCountInitByOneQuitAll(void *arg)
|
||||
{
|
||||
int result;
|
||||
/* Ensure that we start with reset subsystems. */
|
||||
@@ -163,7 +165,7 @@ static int subsystems_dependRefCountInitByOneQuitAll()
|
||||
* \sa SDL_QuitSubSystem
|
||||
*
|
||||
*/
|
||||
static int subsystems_dependRefCountWithExtraInit()
|
||||
static int SDLCALL subsystems_dependRefCountWithExtraInit(void *arg)
|
||||
{
|
||||
int result;
|
||||
/* Ensure that we start with reset subsystems. */
|
||||
@@ -210,19 +212,19 @@ static int subsystems_dependRefCountWithExtraInit()
|
||||
|
||||
/* Subsystems test cases */
|
||||
static const SDLTest_TestCaseReference subsystemsTest1 = {
|
||||
(SDLTest_TestCaseFp)subsystems_referenceCount, "subsystems_referenceCount", "Makes sure that subsystem stays until number of quits matches inits.", TEST_ENABLED
|
||||
subsystems_referenceCount, "subsystems_referenceCount", "Makes sure that subsystem stays until number of quits matches inits.", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference subsystemsTest2 = {
|
||||
(SDLTest_TestCaseFp)subsystems_dependRefCountInitAllQuitByOne, "subsystems_dependRefCountInitAllQuitByOne", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
subsystems_dependRefCountInitAllQuitByOne, "subsystems_dependRefCountInitAllQuitByOne", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference subsystemsTest3 = {
|
||||
(SDLTest_TestCaseFp)subsystems_dependRefCountInitByOneQuitAll, "subsystems_dependRefCountInitByOneQuitAll", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
subsystems_dependRefCountInitByOneQuitAll, "subsystems_dependRefCountInitByOneQuitAll", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
};
|
||||
|
||||
static const SDLTest_TestCaseReference subsystemsTest4 = {
|
||||
(SDLTest_TestCaseFp)subsystems_dependRefCountWithExtraInit, "subsystems_dependRefCountWithExtraInit", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
subsystems_dependRefCountWithExtraInit, "subsystems_dependRefCountWithExtraInit", "Check reference count of subsystem dependencies.", TEST_ENABLED
|
||||
};
|
||||
|
||||
/* Sequence of Events test cases */
|
||||
|
||||
Reference in New Issue
Block a user