SDL
2.0
|
Go to the source code of this file.
Data Structures | |
struct | SDLTest_TestCaseReference |
struct | SDLTest_TestSuiteReference |
Macros | |
#define | TEST_ENABLED 1 |
#define | TEST_DISABLED 0 |
#define | TEST_ABORTED -1 |
#define | TEST_STARTED 0 |
#define | TEST_COMPLETED 1 |
#define | TEST_SKIPPED 2 |
#define | TEST_RESULT_PASSED 0 |
#define | TEST_RESULT_FAILED 1 |
#define | TEST_RESULT_NO_ASSERT 2 |
#define | TEST_RESULT_SKIPPED 3 |
#define | TEST_RESULT_SETUP_FAILURE 4 |
Typedefs | |
typedef void(* | SDLTest_TestCaseSetUpFp) (void *arg) |
typedef int(* | SDLTest_TestCaseFp) (void *arg) |
typedef void(* | SDLTest_TestCaseTearDownFp) (void *arg) |
Functions | |
char * | SDLTest_GenerateRunSeed (const int length) |
Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z). More... | |
int | SDLTest_RunSuites (SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations) |
Execute a test suite using the given run seed and execution key. More... | |
Include file for SDL test framework.
This code is a part of the SDL2_test library, not the main SDL library.
Definition in file SDL_test_harness.h.
#define TEST_ABORTED -1 |
Definition at line 51 of file SDL_test_harness.h.
Referenced by audio_convertAudio(), audio_lockUnlockOpenAudioDevice(), audio_openCloseAndGetAudioStatus(), audio_openCloseAudioDeviceConnected(), keyboard_getScancodeFromNameNegative(), mouse_createFreeColorCursor(), mouse_createFreeCursor(), mouse_getMouseFocus(), mouse_setCursor(), mouse_showCursor(), mouse_warpMouseInWindow(), pixels_calcGammaRamp(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), rwops_testAllocFree(), rwops_testConstMem(), rwops_testFileRead(), rwops_testFileWrite(), rwops_testFileWriteReadEndian(), rwops_testFPRead(), rwops_testFPWrite(), rwops_testMem(), SDLTest_BailOut(), SDLTest_RunTest(), surface_testCompleteSurfaceConversion(), surface_testSaveLoadBitmap(), surface_testSurfaceConversion(), syswm_getWindowWMInfo(), video_getClosestDisplayModeCurrentResolution(), video_getSetWindowData(), video_getSetWindowGrab(), video_getSetWindowMaximumSize(), video_getSetWindowMinimumSize(), video_getSetWindowPosition(), video_getSetWindowSize(), video_getWindowGammaRamp(), video_getWindowId(), and video_getWindowPixelFormat().
#define TEST_COMPLETED 1 |
Definition at line 53 of file SDL_test_harness.h.
Referenced by audio_buildAudioCVT(), audio_buildAudioCVTNegative(), audio_convertAudio(), audio_enumerateAndNameAudioDevices(), audio_enumerateAndNameAudioDevicesNegativeTests(), audio_getAudioStatus(), audio_initOpenCloseQuitAudio(), audio_initQuitAudio(), audio_lockUnlockOpenAudioDevice(), audio_openCloseAndGetAudioStatus(), audio_openCloseAudioDeviceConnected(), audio_pauseUnpauseAudio(), audio_printAudioDrivers(), audio_printCurrentAudioDriver(), audio_quitInitAudioSubSystem(), clipboard_testClipboardTextFunctions(), clipboard_testGetClipboardText(), clipboard_testHasClipboardText(), clipboard_testSetClipboardText(), events_addDelEventWatch(), events_addDelEventWatchWithUserdata(), events_pushPumpAndPollUserevent(), hints_getHint(), hints_setHint(), keyboard_getKeyboardFocus(), keyboard_getKeyboardState(), keyboard_getKeyFromName(), keyboard_getKeyFromScancode(), keyboard_getKeyName(), keyboard_getKeyNameNegative(), keyboard_getScancodeFromKey(), keyboard_getScancodeFromName(), keyboard_getScancodeFromNameNegative(), keyboard_getScancodeNameNegative(), keyboard_getSetModState(), keyboard_setTextInputRect(), keyboard_setTextInputRectNegative(), keyboard_startStopTextInput(), main_testImpliedJoystickInit(), main_testImpliedJoystickQuit(), main_testInitQuitJoystickHaptic(), main_testInitQuitSubSystem(), mouse_createFreeColorCursor(), mouse_createFreeCursor(), mouse_getCursor(), mouse_getMouseFocus(), mouse_getMouseState(), mouse_getRelativeMouseState(), mouse_getSetRelativeMouseMode(), mouse_setCursor(), mouse_showCursor(), mouse_warpMouseInWindow(), pixels_allocFreeFormat(), pixels_allocFreePalette(), pixels_calcGammaRamp(), pixels_getPixelFormatName(), platform_testDefaultInit(), platform_testEndianessAndSwap(), platform_testGetFunctions(), platform_testGetPowerInfo(), platform_testGetSetClearError(), platform_testGetVersion(), platform_testHasFunctions(), platform_testSDLVersion(), platform_testSetErrorEmptyInput(), platform_testSetErrorInvalidInput(), platform_testTypes(), rect_testEnclosePoints(), rect_testEnclosePointsParam(), rect_testEnclosePointsRepeatedInput(), rect_testEnclosePointsWithClipping(), rect_testHasIntersectionEmpty(), rect_testHasIntersectionInside(), rect_testHasIntersectionOutside(), rect_testHasIntersectionParam(), rect_testHasIntersectionPartial(), rect_testHasIntersectionPoint(), rect_testIntersectRectAndLine(), rect_testIntersectRectAndLineEmpty(), rect_testIntersectRectAndLineInside(), rect_testIntersectRectAndLineOutside(), rect_testIntersectRectAndLineParam(), rect_testIntersectRectEmpty(), rect_testIntersectRectInside(), rect_testIntersectRectOutside(), rect_testIntersectRectParam(), rect_testIntersectRectPartial(), rect_testIntersectRectPoint(), rect_testRectEmpty(), rect_testRectEmptyParam(), rect_testRectEquals(), rect_testRectEqualsParam(), rect_testUnionRectEmpty(), rect_testUnionRectInside(), rect_testUnionRectOutside(), rect_testUnionRectParam(), render_testBlit(), render_testBlitAlpha(), render_testBlitBlend(), render_testBlitColor(), render_testGetNumRenderDrivers(), render_testPrimitives(), render_testPrimitivesBlend(), rwops_testAllocFree(), rwops_testCompareRWFromMemWithRWFromFile(), rwops_testConstMem(), rwops_testFileRead(), rwops_testFileWrite(), rwops_testFileWriteReadEndian(), rwops_testFPRead(), rwops_testFPWrite(), rwops_testMem(), rwops_testParamNegative(), sdltest_generateRunSeed(), sdltest_getFuzzerInvocationCount(), sdltest_randomAsciiString(), sdltest_randomAsciiStringOfSize(), sdltest_randomAsciiStringWithMaximumLength(), sdltest_randomBoundaryNumberSint16(), sdltest_randomBoundaryNumberSint32(), sdltest_randomBoundaryNumberSint64(), sdltest_randomBoundaryNumberSint8(), sdltest_randomBoundaryNumberUint16(), sdltest_randomBoundaryNumberUint32(), sdltest_randomBoundaryNumberUint64(), sdltest_randomBoundaryNumberUint8(), sdltest_randomIntegerInRange(), sdltest_randomNumber(), stdlib_getsetenv(), stdlib_snprintf(), stdlib_sscanf(), stdlib_strlcpy(), surface_testBlit(), surface_testBlitAlphaMod(), surface_testBlitBlendAdd(), surface_testBlitBlendBlend(), surface_testBlitBlendLoop(), surface_testBlitBlendMod(), surface_testBlitBlendNone(), surface_testBlitColorMod(), surface_testCompleteSurfaceConversion(), surface_testLoadFailure(), surface_testSaveLoadBitmap(), surface_testSurfaceConversion(), syswm_getWindowWMInfo(), timer_addRemoveTimer(), timer_delayAndGetTicks(), timer_getPerformanceCounter(), timer_getPerformanceFrequency(), video_createWindowVariousFlags(), video_createWindowVariousPositions(), video_createWindowVariousSizes(), video_enableDisableScreensaver(), video_getClosestDisplayModeCurrentResolution(), video_getClosestDisplayModeRandomResolution(), video_getNumDisplayModes(), video_getNumDisplayModesNegative(), video_getSetWindowData(), video_getSetWindowGrab(), video_getSetWindowMaximumSize(), video_getSetWindowMinimumSize(), video_getSetWindowPosition(), video_getSetWindowSize(), video_getWindowBrightness(), video_getWindowBrightnessNegative(), video_getWindowDisplayMode(), video_getWindowDisplayModeNegative(), video_getWindowFlags(), video_getWindowGammaRamp(), video_getWindowGammaRampNegative(), video_getWindowId(), and video_getWindowPixelFormat().
#define TEST_DISABLED 0 |
Definition at line 48 of file SDL_test_harness.h.
#define TEST_ENABLED 1 |
Definition at line 47 of file SDL_test_harness.h.
#define TEST_RESULT_FAILED 1 |
Definition at line 58 of file SDL_test_harness.h.
Referenced by SDLTest_AssertSummaryToTestResult(), SDLTest_RunSuites(), and SDLTest_RunTest().
#define TEST_RESULT_NO_ASSERT 2 |
Definition at line 59 of file SDL_test_harness.h.
Referenced by SDLTest_AssertSummaryToTestResult(), and SDLTest_RunSuites().
#define TEST_RESULT_PASSED 0 |
Definition at line 57 of file SDL_test_harness.h.
Referenced by SDLTest_AssertSummaryToTestResult(), and SDLTest_RunSuites().
#define TEST_RESULT_SETUP_FAILURE 4 |
Definition at line 61 of file SDL_test_harness.h.
Referenced by SDLTest_RunTest().
#define TEST_RESULT_SKIPPED 3 |
Definition at line 60 of file SDL_test_harness.h.
Referenced by SDLTest_RunSuites(), and SDLTest_RunTest().
#define TEST_SKIPPED 2 |
Definition at line 54 of file SDL_test_harness.h.
Referenced by main_testImpliedJoystickInit(), main_testImpliedJoystickQuit(), main_testInitQuitJoystickHaptic(), main_testInitQuitSubSystem(), and SDLTest_RunTest().
#define TEST_STARTED 0 |
Definition at line 52 of file SDL_test_harness.h.
Referenced by SDLTest_RunTest().
typedef int(* SDLTest_TestCaseFp) (void *arg) |
Definition at line 67 of file SDL_test_harness.h.
Definition at line 64 of file SDL_test_harness.h.
Definition at line 70 of file SDL_test_harness.h.
char* SDLTest_GenerateRunSeed | ( | const int | length | ) |
Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
Note: The returned string needs to be deallocated by the caller.
length | The length of the seed string to generate |
Generates a random run seed string for the harness. The generated seed will contain alphanumeric characters (0-9A-Z).
Note: The returned string needs to be deallocated by the caller.
length | The length of the seed string to generate |
Definition at line 54 of file SDL_test_harness.c.
int SDLTest_RunSuites | ( | SDLTest_TestSuiteReference * | testSuites[], |
const char * | userRunSeed, | ||
Uint64 | userExecKey, | ||
const char * | filter, | ||
int | testIterations | ||
) |
Execute a test suite using the given run seed and execution key.
testSuites | Suites containing the test case. |
userRunSeed | Custom run seed provided by user, or NULL to autogenerate one. |
userExecKey | Custom execution key provided by user, or 0 to autogenerate one. |
filter | Filter specification. NULL disables. Case sensitive. |
testIterations | Number of iterations to run each test case. |
The filter string is matched to the suite name (full comparison) to select a single suite, or if no suite matches, it is matched to the test names (full comparison) to select a single test.
testSuites | Suites containing the test case. |
userRunSeed | Custom run seed provided by user, or NULL to autogenerate one. |
userExecKey | Custom execution key provided by user, or 0 to autogenerate one. |
filter | Filter specification. NULL disables. Case sensitive. |
testIterations | Number of iterations to run each test case. |
Definition at line 367 of file SDL_test_harness.c.
References SDLTest_TestCaseReference::description, SDLTest_TestCaseReference::enabled, GetClock(), SDLTest_TestCaseReference::name, SDLTest_TestSuiteReference::name, NULL, SDL_ENOMEM, SDL_Error, SDL_FALSE, SDL_free, SDL_malloc, SDL_PRIu64, SDL_strcmp, SDL_TRUE, SDLTEST_FINAL_RESULT_FORMAT, SDLTest_GenerateExecKey(), SDLTest_GenerateRunSeed(), SDLTEST_INVALID_NAME_FORMAT, SDLTest_Log(), SDLTEST_LOG_SUMMARY_FORMAT, SDLTest_LogError(), SDLTest_RunTest(), TEST_RESULT_FAILED, TEST_RESULT_NO_ASSERT, TEST_RESULT_PASSED, TEST_RESULT_SKIPPED, and SDLTest_TestSuiteReference::testCases.
Referenced by main().