mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-21 23:05:49 +00:00
SDL_test: use SDLCALL calling convention
This is needed when using a pre-built static SDL3_test library.
This commit is contained in:
committed by
Anonymous Maarten
parent
379aea5c2d
commit
db96ddca34
@@ -54,7 +54,7 @@ extern "C" {
|
||||
* \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
|
||||
* \param assertDescription Message to log with the assert describing it.
|
||||
*/
|
||||
void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
void SDLCALL SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
* Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
|
||||
@@ -64,32 +64,31 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as
|
||||
*
|
||||
* \returns the assertCondition so it can be used to externally to break execution flow if desired.
|
||||
*/
|
||||
int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
int SDLCALL SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
* Explicitly pass without checking an assertion condition. Updates assertion counter.
|
||||
*
|
||||
* \param assertDescription Message to log with the assert describing it.
|
||||
*/
|
||||
void SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
void SDLCALL SDLTest_AssertPass(SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/*
|
||||
* Resets the assert summary counters to zero.
|
||||
*/
|
||||
void SDLTest_ResetAssertSummary(void);
|
||||
void SDLCALL SDLTest_ResetAssertSummary(void);
|
||||
|
||||
/*
|
||||
* Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
|
||||
*/
|
||||
void SDLTest_LogAssertSummary(void);
|
||||
|
||||
void SDLCALL SDLTest_LogAssertSummary(void);
|
||||
|
||||
/*
|
||||
* Converts the current assert summary state to a test result.
|
||||
*
|
||||
* \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
|
||||
*/
|
||||
int SDLTest_AssertSummaryToTestResult(void);
|
||||
int SDLCALL SDLTest_AssertSummaryToTestResult(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -55,10 +55,10 @@ typedef Uint32 SDLTest_VerboseFlags;
|
||||
|
||||
/* !< Function pointer parsing one argument at argv[index], returning the number of parsed arguments,
|
||||
* or a negative value when the argument is invalid */
|
||||
typedef int (*SDLTest_ParseArgumentsFp)(void *data, char **argv, int index);
|
||||
typedef int (SDLCALL *SDLTest_ParseArgumentsFp)(void *data, char **argv, int index);
|
||||
|
||||
/* !< Finalize the argument parser. */
|
||||
typedef void (*SDLTest_FinalizeArgumentParserFp)(void *arg);
|
||||
typedef void (SDLCALL *SDLTest_FinalizeArgumentParserFp)(void *arg);
|
||||
|
||||
typedef struct SDLTest_ArgumentParser
|
||||
{
|
||||
@@ -179,7 +179,7 @@ extern "C" {
|
||||
*
|
||||
* \returns a newly allocated common state object.
|
||||
*/
|
||||
SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, SDL_InitFlags flags);
|
||||
SDLTest_CommonState *SDLCALL SDLTest_CommonCreateState(char **argv, SDL_InitFlags flags);
|
||||
|
||||
/**
|
||||
* Free the common state object.
|
||||
@@ -188,7 +188,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, SDL_InitFlags flags)
|
||||
*
|
||||
* \param state The common state object to destroy
|
||||
*/
|
||||
void SDLTest_CommonDestroyState(SDLTest_CommonState *state);
|
||||
void SDLCALL SDLTest_CommonDestroyState(SDLTest_CommonState *state);
|
||||
|
||||
/**
|
||||
* Process one common argument.
|
||||
@@ -198,7 +198,7 @@ void SDLTest_CommonDestroyState(SDLTest_CommonState *state);
|
||||
*
|
||||
* \returns the number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
|
||||
*/
|
||||
int SDLTest_CommonArg(SDLTest_CommonState *state, int index);
|
||||
int SDLCALL SDLTest_CommonArg(SDLTest_CommonState *state, int index);
|
||||
|
||||
|
||||
/**
|
||||
@@ -213,7 +213,7 @@ int SDLTest_CommonArg(SDLTest_CommonState *state, int index);
|
||||
* \param argv0 argv[0], as passed to main/SDL_main.
|
||||
* \param options an array of strings for application specific options. The last element of the array should be NULL.
|
||||
*/
|
||||
void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const char **options);
|
||||
void SDLCALL SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const char **options);
|
||||
|
||||
/**
|
||||
* Open test window.
|
||||
@@ -222,7 +222,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const
|
||||
*
|
||||
* \returns SDL_TRUE if initialization succeeded, false otherwise
|
||||
*/
|
||||
SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state);
|
||||
SDL_bool SDLCALL SDLTest_CommonInit(SDLTest_CommonState *state);
|
||||
|
||||
/**
|
||||
* Easy argument handling when test app doesn't need any custom args.
|
||||
@@ -233,7 +233,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state);
|
||||
*
|
||||
* \returns SDL_FALSE if app should quit, true otherwise.
|
||||
*/
|
||||
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv);
|
||||
SDL_bool SDLCALL SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv);
|
||||
|
||||
/**
|
||||
* Print the details of an event.
|
||||
@@ -242,7 +242,7 @@ SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, c
|
||||
*
|
||||
* \param event The event to print.
|
||||
*/
|
||||
void SDLTest_PrintEvent(const SDL_Event *event);
|
||||
void SDLCALL SDLTest_PrintEvent(const SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Common event handler for test windows if you use a standard SDL_main.
|
||||
@@ -251,7 +251,7 @@ void SDLTest_PrintEvent(const SDL_Event *event);
|
||||
* \param event The event to handle.
|
||||
* \param done Flag indicating we are done.
|
||||
*/
|
||||
void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done);
|
||||
void SDLCALL SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done);
|
||||
|
||||
/**
|
||||
* Common event handler for test windows if you use SDL_AppEvent.
|
||||
@@ -262,7 +262,7 @@ void SDLTest_CommonEvent(SDLTest_CommonState *state, SDL_Event *event, int *done
|
||||
* \param event The event to handle.
|
||||
* \returns Value suitable for returning from SDL_AppEvent().
|
||||
*/
|
||||
SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event *event);
|
||||
SDL_AppResult SDLCALL SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event *event);
|
||||
|
||||
/**
|
||||
* Close test window.
|
||||
@@ -270,7 +270,7 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
* \param state The common state used to create test window.
|
||||
*
|
||||
*/
|
||||
void SDLTest_CommonQuit(SDLTest_CommonState *state);
|
||||
void SDLCALL SDLTest_CommonQuit(SDLTest_CommonState *state);
|
||||
|
||||
/**
|
||||
* Draws various window information (position, size, etc.) to the renderer.
|
||||
@@ -280,7 +280,7 @@ void SDLTest_CommonQuit(SDLTest_CommonState *state);
|
||||
* \param usedHeight Returns the height used, so the caller can draw more below.
|
||||
*
|
||||
*/
|
||||
void SDLTest_CommonDrawWindowInfo(SDL_Renderer *renderer, SDL_Window *window, float *usedHeight);
|
||||
void SDLCALL SDLTest_CommonDrawWindowInfo(SDL_Renderer *renderer, SDL_Window *window, float *usedHeight);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -53,7 +53,7 @@ extern "C" {
|
||||
*
|
||||
* \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ.
|
||||
*/
|
||||
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
|
||||
int SDLCALL SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error);
|
||||
|
||||
/**
|
||||
* Compares 2 memory blocks for equality
|
||||
@@ -67,7 +67,7 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface,
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
extern int SDLTest_CompareMemory(const void *actual, size_t size_actual, const void *reference, size_t size_reference);
|
||||
int SDLCALL SDLTest_CompareMemory(const void *actual, size_t size_actual, const void *reference, size_t size_reference);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -77,7 +77,7 @@ extern "C" {
|
||||
* \returns 0 for OK, -1 on error
|
||||
*
|
||||
*/
|
||||
int SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext);
|
||||
int SDLCALL SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext);
|
||||
|
||||
|
||||
/*
|
||||
@@ -91,12 +91,12 @@ extern "C" {
|
||||
* \returns 0 for OK, -1 on error
|
||||
*
|
||||
*/
|
||||
int SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
||||
int SDLCALL SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
||||
|
||||
/* Same routine broken down into three steps */
|
||||
int SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
|
||||
int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
|
||||
int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
||||
int SDLCALL SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
|
||||
int SDLCALL SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32);
|
||||
int SDLCALL SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32);
|
||||
|
||||
|
||||
/*
|
||||
@@ -108,7 +108,7 @@ int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, C
|
||||
*
|
||||
*/
|
||||
|
||||
int SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext);
|
||||
int SDLCALL SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext);
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
@@ -56,7 +56,7 @@ extern int FONT_CHARACTER_SIZE;
|
||||
*
|
||||
* \returns SDL_TRUE on success, SDL_FALSE on failure.
|
||||
*/
|
||||
SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
|
||||
SDL_bool SDLCALL SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c);
|
||||
|
||||
/*
|
||||
* Draw a UTF-8 string in the currently set font.
|
||||
@@ -70,7 +70,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32
|
||||
*
|
||||
* \returns SDL_TRUE on success, SDL_FALSE on failure.
|
||||
*/
|
||||
SDL_bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
|
||||
SDL_bool SDLCALL SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s);
|
||||
|
||||
/*
|
||||
* Data used for multi-line text output
|
||||
@@ -95,7 +95,7 @@ typedef struct SDLTest_TextWindow
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
SDLTest_TextWindow *SDLTest_TextWindowCreate(float x, float y, float w, float h);
|
||||
SDLTest_TextWindow * SDLCALL SDLTest_TextWindowCreate(float x, float y, float w, float h);
|
||||
|
||||
/*
|
||||
* Display a multi-line text output window
|
||||
@@ -107,7 +107,7 @@ SDLTest_TextWindow *SDLTest_TextWindowCreate(float x, float y, float w, float h)
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
|
||||
void SDLCALL SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
|
||||
|
||||
/*
|
||||
* Add text to a multi-line text output window
|
||||
@@ -122,7 +122,7 @@ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *render
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
void SDLCALL SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
|
||||
|
||||
/*
|
||||
* Add text to a multi-line text output window
|
||||
@@ -137,7 +137,7 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_ST
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
|
||||
void SDLCALL SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
|
||||
|
||||
/*
|
||||
* Clear the text in a multi-line text output window
|
||||
@@ -146,7 +146,7 @@ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
|
||||
void SDLCALL SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
|
||||
|
||||
/*
|
||||
* Free the storage associated with a multi-line text output window
|
||||
@@ -155,12 +155,12 @@ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
|
||||
*
|
||||
* \since This function is available since SDL 3.0.0.
|
||||
*/
|
||||
void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
|
||||
void SDLCALL SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
|
||||
|
||||
/*
|
||||
* Cleanup textures used by font drawing functions.
|
||||
*/
|
||||
void SDLTest_CleanupTextDrawing(void);
|
||||
void SDLCALL SDLTest_CleanupTextDrawing(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -59,7 +59,7 @@ extern "C" {
|
||||
* \param execKey Execution "Key" that initializes the random number generator uniquely for the test.
|
||||
*
|
||||
*/
|
||||
void SDLTest_FuzzerInit(Uint64 execKey);
|
||||
void SDLCALL SDLTest_FuzzerInit(Uint64 execKey);
|
||||
|
||||
|
||||
/**
|
||||
@@ -67,14 +67,14 @@ void SDLTest_FuzzerInit(Uint64 execKey);
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint8 SDLTest_RandomUint8(void);
|
||||
Uint8 SDLCALL SDLTest_RandomUint8(void);
|
||||
|
||||
/**
|
||||
* Returns a random Sint8
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
*/
|
||||
Sint8 SDLTest_RandomSint8(void);
|
||||
Sint8 SDLCALL SDLTest_RandomSint8(void);
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,14 +82,14 @@ Sint8 SDLTest_RandomSint8(void);
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint16 SDLTest_RandomUint16(void);
|
||||
Uint16 SDLCALL SDLTest_RandomUint16(void);
|
||||
|
||||
/**
|
||||
* Returns a random Sint16
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
*/
|
||||
Sint16 SDLTest_RandomSint16(void);
|
||||
Sint16 SDLCALL SDLTest_RandomSint16(void);
|
||||
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ Sint16 SDLTest_RandomSint16(void);
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Sint32 SDLTest_RandomSint32(void);
|
||||
Sint32 SDLCALL SDLTest_RandomSint32(void);
|
||||
|
||||
|
||||
/**
|
||||
@@ -105,7 +105,7 @@ Sint32 SDLTest_RandomSint32(void);
|
||||
*
|
||||
* \returns a generated integer
|
||||
*/
|
||||
Uint32 SDLTest_RandomUint32(void);
|
||||
Uint32 SDLCALL SDLTest_RandomUint32(void);
|
||||
|
||||
/**
|
||||
* Returns random Uint64.
|
||||
@@ -120,29 +120,29 @@ Uint64 SDLTest_RandomUint64(void);
|
||||
*
|
||||
* \returns a generated signed integer
|
||||
*/
|
||||
Sint64 SDLTest_RandomSint64(void);
|
||||
Sint64 SDLCALL SDLTest_RandomSint64(void);
|
||||
|
||||
/**
|
||||
* \returns a random float in range [0.0 - 1.0]
|
||||
*/
|
||||
float SDLTest_RandomUnitFloat(void);
|
||||
float SDLCALL SDLTest_RandomUnitFloat(void);
|
||||
|
||||
/**
|
||||
* \returns a random double in range [0.0 - 1.0]
|
||||
*/
|
||||
double SDLTest_RandomUnitDouble(void);
|
||||
double SDLCALL SDLTest_RandomUnitDouble(void);
|
||||
|
||||
/**
|
||||
* \returns a random float.
|
||||
*
|
||||
*/
|
||||
float SDLTest_RandomFloat(void);
|
||||
float SDLCALL SDLTest_RandomFloat(void);
|
||||
|
||||
/**
|
||||
* \returns a random double.
|
||||
*
|
||||
*/
|
||||
double SDLTest_RandomDouble(void);
|
||||
double SDLCALL SDLTest_RandomDouble(void);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Uint8 within the given boundaries.
|
||||
@@ -163,7 +163,7 @@ double SDLTest_RandomDouble(void);
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or 0 with error set
|
||||
*/
|
||||
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
|
||||
Uint8 SDLCALL SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Uint16 within the given boundaries.
|
||||
@@ -184,7 +184,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or 0 with error set
|
||||
*/
|
||||
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
|
||||
Uint16 SDLCALL SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Uint32 within the given boundaries.
|
||||
@@ -205,7 +205,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or 0 with error set
|
||||
*/
|
||||
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
|
||||
Uint32 SDLCALL SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Uint64 within the given boundaries.
|
||||
@@ -226,7 +226,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or 0 with error set
|
||||
*/
|
||||
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
|
||||
Uint64 SDLCALL SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Sint8 within the given boundaries.
|
||||
@@ -247,7 +247,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or SINT8_MIN with error set
|
||||
*/
|
||||
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
|
||||
Sint8 SDLCALL SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
|
||||
|
||||
|
||||
/**
|
||||
@@ -269,7 +269,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or SINT16_MIN with error set
|
||||
*/
|
||||
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
|
||||
Sint16 SDLCALL SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Sint32 within the given boundaries.
|
||||
@@ -290,7 +290,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or SINT32_MIN with error set
|
||||
*/
|
||||
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
|
||||
Sint32 SDLCALL SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
|
||||
|
||||
/**
|
||||
* Returns a random boundary value for Sint64 within the given boundaries.
|
||||
@@ -311,7 +311,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
|
||||
*
|
||||
* \returns a random boundary value for the given range and domain or SINT64_MIN with error set
|
||||
*/
|
||||
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
|
||||
Sint64 SDLCALL SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
|
||||
|
||||
|
||||
/**
|
||||
@@ -325,7 +325,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
|
||||
*
|
||||
* \returns a generated random integer in range
|
||||
*/
|
||||
Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
||||
Sint32 SDLCALL SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
||||
|
||||
|
||||
/**
|
||||
@@ -337,7 +337,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
|
||||
*
|
||||
* \returns a newly allocated random string; or NULL if length was invalid or string could not be allocated.
|
||||
*/
|
||||
char *SDLTest_RandomAsciiString(void);
|
||||
char * SDLCALL SDLTest_RandomAsciiString(void);
|
||||
|
||||
|
||||
/**
|
||||
@@ -351,7 +351,7 @@ char *SDLTest_RandomAsciiString(void);
|
||||
*
|
||||
* \returns a newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
|
||||
*/
|
||||
char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
||||
char * SDLCALL SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
||||
|
||||
|
||||
/**
|
||||
@@ -365,14 +365,14 @@ char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
|
||||
*
|
||||
* \returns a newly allocated random string; or NULL if size was invalid or string could not be allocated.
|
||||
*/
|
||||
char *SDLTest_RandomAsciiStringOfSize(int size);
|
||||
char * SDLCALL SDLTest_RandomAsciiStringOfSize(int size);
|
||||
|
||||
/**
|
||||
* Get the invocation count for the fuzzer since last ...FuzzerInit.
|
||||
*
|
||||
* \returns the invocation count.
|
||||
*/
|
||||
int SDLTest_GetFuzzerInvocationCount(void);
|
||||
int SDLCALL SDLTest_GetFuzzerInvocationCount(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -63,13 +63,13 @@ extern "C" {
|
||||
#define TEST_RESULT_SETUP_FAILURE 4
|
||||
|
||||
/* !< Function pointer to a test case setup function (run before every test) */
|
||||
typedef void (*SDLTest_TestCaseSetUpFp)(void **arg);
|
||||
typedef void (SDLCALL *SDLTest_TestCaseSetUpFp)(void **arg);
|
||||
|
||||
/* !< Function pointer to a test case function */
|
||||
typedef int (*SDLTest_TestCaseFp)(void *arg);
|
||||
typedef int (SDLCALL *SDLTest_TestCaseFp)(void *arg);
|
||||
|
||||
/* !< Function pointer to a test case teardown function (run after every test) */
|
||||
typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
|
||||
typedef void (SDLCALL *SDLTest_TestCaseTearDownFp)(void *arg);
|
||||
|
||||
/*
|
||||
* Holds information about a single test case.
|
||||
@@ -109,7 +109,7 @@ typedef struct SDLTest_TestSuiteReference {
|
||||
*
|
||||
* \returns A null-terminated seed string and equal to the in put buffer on success, NULL on failure
|
||||
*/
|
||||
char *SDLTest_GenerateRunSeed(char *buffer, int length);
|
||||
char * SDLCALL SDLTest_GenerateRunSeed(char *buffer, int length);
|
||||
|
||||
/*
|
||||
* Holds information about the execution of test suites.
|
||||
@@ -125,7 +125,7 @@ typedef struct SDLTest_TestSuiteRunner SDLTest_TestSuiteRunner;
|
||||
*
|
||||
* \returns the test run result: 0 when all tests passed, 1 if any tests failed.
|
||||
*/
|
||||
SDLTest_TestSuiteRunner * SDLTest_CreateTestSuiteRunner(SDLTest_CommonState *state, SDLTest_TestSuiteReference *testSuites[]);
|
||||
SDLTest_TestSuiteRunner * SDLCALL SDLTest_CreateTestSuiteRunner(SDLTest_CommonState *state, SDLTest_TestSuiteReference *testSuites[]);
|
||||
|
||||
/*
|
||||
* Destroy a test suite runner.
|
||||
@@ -133,7 +133,7 @@ SDLTest_TestSuiteRunner * SDLTest_CreateTestSuiteRunner(SDLTest_CommonState *sta
|
||||
*
|
||||
* \param runner The runner that should be destroyed.
|
||||
*/
|
||||
void SDLTest_DestroyTestSuiteRunner(SDLTest_TestSuiteRunner *runner);
|
||||
void SDLCALL SDLTest_DestroyTestSuiteRunner(SDLTest_TestSuiteRunner *runner);
|
||||
|
||||
/*
|
||||
* Execute a test suite, using the configured run seed, execution key, filter, etc.
|
||||
@@ -142,8 +142,7 @@ void SDLTest_DestroyTestSuiteRunner(SDLTest_TestSuiteRunner *runner);
|
||||
*
|
||||
* \returns the test run result: 0 when all tests passed, 1 if any tests failed.
|
||||
*/
|
||||
int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner);
|
||||
|
||||
int SDLCALL SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -49,14 +49,14 @@ extern "C" {
|
||||
*
|
||||
* \param fmt Message to be logged
|
||||
*/
|
||||
void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
void SDLCALL SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/**
|
||||
* Prints given message with a timestamp in the TEST category and the ERROR priority.
|
||||
*
|
||||
* \param fmt Message to be logged
|
||||
*/
|
||||
void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
void SDLCALL SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -88,8 +88,7 @@ extern "C" {
|
||||
* mdContext. Call before each new use of the context -
|
||||
* all fields are set to zero.
|
||||
*/
|
||||
void SDLTest_Md5Init(SDLTest_Md5Context *mdContext);
|
||||
|
||||
void SDLCALL SDLTest_Md5Init(SDLTest_Md5Context *mdContext);
|
||||
|
||||
/**
|
||||
* update digest from variable length data
|
||||
@@ -101,9 +100,8 @@ extern "C" {
|
||||
* Note: The function updates the message-digest context to account
|
||||
* for the presence of each of the characters inBuf[0..inLen-1]
|
||||
* in the message whose digest is being computed.
|
||||
*/
|
||||
|
||||
void SDLTest_Md5Update(SDLTest_Md5Context *mdContext, unsigned char *inBuf,
|
||||
*/
|
||||
void SDLCALL SDLTest_Md5Update(SDLTest_Md5Context *mdContext, unsigned char *inBuf,
|
||||
unsigned int inLen);
|
||||
|
||||
|
||||
@@ -115,10 +113,8 @@ extern "C" {
|
||||
* Note: The function terminates the message-digest computation and
|
||||
* ends with the desired message digest in mdContext.digest[0..15].
|
||||
* Always call before using the digest[] variable.
|
||||
*/
|
||||
|
||||
void SDLTest_Md5Final(SDLTest_Md5Context *mdContext);
|
||||
|
||||
*/
|
||||
void SDLCALL SDLTest_Md5Final(SDLTest_Md5Context *mdContext);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -36,28 +36,26 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Start tracking SDL memory allocations
|
||||
*
|
||||
* \note This should be called before any other SDL functions for complete tracking coverage
|
||||
*/
|
||||
void SDLTest_TrackAllocations(void);
|
||||
void SDLCALL SDLTest_TrackAllocations(void);
|
||||
|
||||
/**
|
||||
* Fill allocations with random data
|
||||
*
|
||||
* \note This implicitly calls SDLTest_TrackAllocations()
|
||||
*/
|
||||
void SDLTest_RandFillAllocations(void);
|
||||
void SDLCALL SDLTest_RandFillAllocations(void);
|
||||
|
||||
/**
|
||||
* Print a log of any outstanding allocations
|
||||
*
|
||||
* \note This can be called after SDL_Quit()
|
||||
*/
|
||||
void SDLTest_LogAllocations(void);
|
||||
|
||||
void SDLCALL SDLTest_LogAllocations(void);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user