zenilib: zenilib/jni/external/sdl/SDL/SDL_test_harness.h File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Typedefs | Functions
SDL_test_harness.h File Reference
`#include "begin_code.h"`
`#include "close_code.h"`

Go to the source code of this file.

## Classes

struct | SDLTest_TestCaseReference
struct | SDLTest_TestSuiteReference

## Macros

#define | TEST_ABORTED -1
#define | TEST_COMPLETED 1
#define | TEST_DISABLED 0
#define | TEST_ENABLED 1
#define | TEST_RESULT_FAILED 1
#define | TEST_RESULT_NO_ASSERT 2
#define | TEST_RESULT_PASSED 0
#define | TEST_RESULT_SETUP_FAILURE 4
#define | TEST_RESULT_SKIPPED 3
#define | TEST_SKIPPED 2
#define | TEST_STARTED 0

## Typedefs

typedef int(* | SDLTest_TestCaseFp )(void *arg)
typedef struct SDLTest_TestCaseReference | SDLTest_TestCaseReference
typedef void(* | SDLTest_TestCaseSetUpFp )(void *arg)
typedef void(* | SDLTest_TestCaseTearDownFp )(void *arg)
typedef struct SDLTest_TestSuiteReference | SDLTest_TestSuiteReference

## Functions

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...

## 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_harness.h.

## Macro Definition Documentation

#define TEST_ABORTED -1

Definition at line 51 of file SDL_test_harness.h.

Referenced by SDLTest_BailOut(), and SDLTest_RunTest().

#define TEST_COMPLETED 1

Definition at line 53 of file SDL_test_harness.h.

#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 SDLTest_RunTest().

#define TEST_STARTED 0

Definition at line 52 of file SDL_test_harness.h.

Referenced by SDLTest_RunTest().

## Typedef Documentation

typedef int(* SDLTest_TestCaseFp)(void *arg)

Definition at line 67 of file SDL_test_harness.h.

typedef struct SDLTest_TestCaseReference SDLTest_TestCaseReference

Holds information about a single test case.

typedef void(* SDLTest_TestCaseSetUpFp)(void *arg)

Definition at line 64 of file SDL_test_harness.h.

typedef void(* SDLTest_TestCaseTearDownFp)(void *arg)

Definition at line 70 of file SDL_test_harness.h.

typedef struct SDLTest_TestSuiteReference SDLTest_TestSuiteReference

Holds information about a test suite (multiple test cases).

## Function Documentation

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.

Parameters

  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.

Returns
  Test run result; 0 when all tests passed, 1 if any tests failed.

Execute a test suite using the given run seed and execution key.

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.

Parameters

  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.

Returns
  Test run result; 0 when all tests passed, 1 if any tests failed.

Definition at line 363 of file SDL_test_harness.c.

References SDLTest_TestCaseReference::description, SDLTest_TestCaseReference::enabled, GetClock(), if(), SDLTest_TestCaseReference::name, SDLTest_TestSuiteReference::name, NULL, SDL_strcmp(), SDLTest_FinalResultFormat, SDLTest_GenerateExecKey(), SDLTest_GenerateRunSeed(), SDLTest_InvalidNameFormat, SDLTest_Log(), SDLTest_LogError(), SDLTest_LogSummaryFormat, SDLTest_RunTest(), TEST_RESULT_FAILED, TEST_RESULT_NO_ASSERT, TEST_RESULT_PASSED, TEST_RESULT_SKIPPED, and SDLTest_TestSuiteReference::testCases.