SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

SDL_test_assert.h File Reference

SDL_test_assert.h File Reference

Include file for SDL test framework. More...

Go to the source code of this file.

Functions

void SDLTest_Assert (int assertCondition, const char *assertDescription,...)
 Assert that logs and break execution flow on failures.
int SDLTest_AssertCheck (int assertCondition, const char *assertDescription,...)
 Assert for test cases that logs but does not break execution flow on failures.
void SDLTest_AssertPass (const char *assertDescription,...)
 Explicitely pass without checking an assertion condition.
void SDLTest_ResetAssertSummary ()
 Resets the assert summary counters to zero.
void SDLTest_LogAssertSummary ()
 Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.
int SDLTest_AssertSummaryToTestResult ()
 Converts the current assert summary state to a test result.

Detailed Description

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.


Function Documentation

void SDLTest_Assert ( int  assertCondition,
const char *  assertDescription,
  ... 
)

Assert that logs and break execution flow on failures.

Parameters:
assertConditionEvaluated condition or variable to assert; fail (==0) or pass (!=0).
assertDescriptionMessage to log with the assert describing it.
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.

Parameters:
assertConditionEvaluated condition or variable to assert; fail (==0) or pass (!=0).
assertDescriptionMessage to log with the assert describing it.
Returns:
Returns the assertCondition so it can be used to externally to break execution flow if desired.
void SDLTest_AssertPass ( const char *  assertDescription,
  ... 
)

Explicitely pass without checking an assertion condition.

Updates assertion counter.

Parameters:
assertDescriptionMessage to log with the assert describing it.
int SDLTest_AssertSummaryToTestResult (  )

Converts the current assert summary state to a test result.

Returns:
TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT
void SDLTest_LogAssertSummary (  )

Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR.

void SDLTest_ResetAssertSummary (  )

Resets the assert summary counters to zero.