zenilib
0.5.3.0
|
Go to the source code of this file.
Macros | |
#define | ASSERT_FAIL 0 |
Fails the assert. More... | |
#define | ASSERT_PASS 1 |
Passes the assert. More... | |
Functions | |
void | SDLTest_Assert (int assertCondition, const char *assertDescription,...) |
Assert that logs and break execution flow on failures. More... | |
int | SDLTest_AssertCheck (int assertCondition, const char *assertDescription,...) |
Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. More... | |
void | SDLTest_AssertPass (const char *assertDescription,...) |
Explicitely pass without checking an assertion condition. Updates assertion counter. More... | |
int | SDLTest_AssertSummaryToTestResult () |
Converts the current assert summary state to a test result. More... | |
void | SDLTest_LogAssertSummary () |
Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. More... | |
void | SDLTest_ResetAssertSummary () |
Resets the assert summary counters to zero. 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_assert.h.
#define ASSERT_FAIL 0 |
Fails the assert.
Definition at line 48 of file SDL_test_assert.h.
Referenced by SDLTest_AssertCheck().
#define ASSERT_PASS 1 |
Passes the assert.
Definition at line 53 of file SDL_test_assert.h.
Assert that logs and break execution flow on failures.
assertCondition | Evaluated condition or variable to assert; fail (==0) or pass (!=0). |
assertDescription | Message to log with the assert describing it. |
Definition at line 47 of file SDL_test_assert.c.
References SDL_assert, SDL_memset(), SDL_vsnprintf(), SDLTest_AssertCheck(), and SDLTEST_MAX_LOGMESSAGE_LENGTH.
Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters.
assertCondition | Evaluated condition or variable to assert; fail (==0) or pass (!=0). |
assertDescription | Message to log with the assert describing it. |
Definition at line 65 of file SDL_test_assert.c.
References ASSERT_FAIL, SDL_memset(), SDL_vsnprintf(), SDLTest_AssertCheckFormat, SDLTest_AssertsFailed, SDLTest_AssertsPassed, SDLTest_Log(), SDLTest_LogError(), and SDLTEST_MAX_LOGMESSAGE_LENGTH.
Referenced by SDLTest_Assert().
Explicitely pass without checking an assertion condition. Updates assertion counter.
assertDescription | Message to log with the assert describing it. |
Definition at line 94 of file SDL_test_assert.c.
References SDL_memset(), SDL_vsnprintf(), SDLTest_AssertCheckFormat, SDLTest_AssertsPassed, SDLTest_Log(), and SDLTEST_MAX_LOGMESSAGE_LENGTH.
int SDLTest_AssertSummaryToTestResult | ( | ) |
Converts the current assert summary state to a test result.
Definition at line 139 of file SDL_test_assert.c.
References SDLTest_AssertsFailed, SDLTest_AssertsPassed, TEST_RESULT_FAILED, TEST_RESULT_NO_ASSERT, and TEST_RESULT_PASSED.
Referenced by SDLTest_RunTest().
void SDLTest_LogAssertSummary | ( | ) |
Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
Definition at line 123 of file SDL_test_assert.c.
References SDLTest_AssertsFailed, SDLTest_AssertsPassed, SDLTest_AssertSummaryFormat, SDLTest_Log(), and SDLTest_LogError().
Referenced by SDLTest_RunTest().
void SDLTest_ResetAssertSummary | ( | ) |
Resets the assert summary counters to zero.
Definition at line 113 of file SDL_test_assert.c.
References SDLTest_AssertsFailed, and SDLTest_AssertsPassed.
Referenced by SDLTest_RunTest().