World of Might and Magic
0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
SDL_test_harness.h
См. документацию.
1
/*
2
Simple DirectMedia Layer
3
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5
This software is provided 'as-is', without any express or implied
6
warranty. In no event will the authors be held liable for any damages
7
arising from the use of this software.
8
9
Permission is granted to anyone to use this software for any purpose,
10
including commercial applications, and to alter it and redistribute it
11
freely, subject to the following restrictions:
12
13
1. The origin of this software must not be misrepresented; you must not
14
claim that you wrote the original software. If you use this software
15
in a product, an acknowledgment in the product documentation would be
16
appreciated but is not required.
17
2. Altered source versions must be plainly marked as such, and must not be
18
misrepresented as being the original software.
19
3. This notice may not be removed or altered from any source distribution.
20
*/
21
30
/*
31
Defines types for test case definitions and the test execution harness API.
32
33
Based on original GSOC code by Markus Kauppila <markus.kauppila@gmail.com>
34
*/
35
36
#ifndef SDL_test_h_arness_h
37
#define SDL_test_h_arness_h
38
39
#include "
begin_code.h
"
40
/* Set up for C function definitions, even when using C++ */
41
#ifdef __cplusplus
42
extern
"C"
{
43
#endif
44
45
46
/* ! Definitions for test case structures */
47
#define TEST_ENABLED 1
48
#define TEST_DISABLED 0
49
50
/* ! Definition of all the possible test return values of the test case method */
51
#define TEST_ABORTED -1
52
#define TEST_STARTED 0
53
#define TEST_COMPLETED 1
54
#define TEST_SKIPPED 2
55
56
/* ! Definition of all the possible test results for the harness */
57
#define TEST_RESULT_PASSED 0
58
#define TEST_RESULT_FAILED 1
59
#define TEST_RESULT_NO_ASSERT 2
60
#define TEST_RESULT_SKIPPED 3
61
#define TEST_RESULT_SETUP_FAILURE 4
62
63
/* !< Function pointer to a test case setup function (run before every test) */
64
typedef
void
(*
SDLTest_TestCaseSetUpFp
)(
void
*arg);
65
66
/* !< Function pointer to a test case function */
67
typedef
int (*
SDLTest_TestCaseFp
)(
void
*arg);
68
69
/* !< Function pointer to a test case teardown function (run after every test) */
70
typedef
void
(*
SDLTest_TestCaseTearDownFp
)(
void
*arg);
71
75
typedef
struct
SDLTest_TestCaseReference
{
76
/* !< Func2Stress */
77
SDLTest_TestCaseFp
testCase
;
78
/* !< Short name (or function name) "Func2Stress" */
79
char
*
name
;
80
/* !< Long name or full description "This test pushes func2() to the limit." */
81
char
*
description
;
82
/* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
83
int
enabled
;
84
}
SDLTest_TestCaseReference
;
85
89
typedef
struct
SDLTest_TestSuiteReference
{
90
/* !< "PlatformSuite" */
91
char
*
name
;
92
/* !< The function that is run before each test. NULL skips. */
93
SDLTest_TestCaseSetUpFp
testSetUp
;
94
/* !< The test cases that are run as part of the suite. Last item should be NULL. */
95
const
SDLTest_TestCaseReference
**
testCases
;
96
/* !< The function that is run after each test. NULL skips. */
97
SDLTest_TestCaseTearDownFp
testTearDown
;
98
}
SDLTest_TestSuiteReference
;
99
100
110
char
*
SDLTest_GenerateRunSeed
(
const
int
length
);
111
123
int
SDLTest_RunSuites
(
SDLTest_TestSuiteReference
*testSuites[],
const
char
*userRunSeed,
Uint64
userExecKey,
const
char
*
filter
,
int
testIterations);
124
125
126
/* Ends C function definitions when using C++ */
127
#ifdef __cplusplus
128
}
129
#endif
130
#include "
close_code.h
"
131
132
#endif
/* SDL_test_h_arness_h */
133
134
/* vi: set ts=4 sw=4 expandtab: */
SDLTest_TestCaseSetUpFp
void(* SDLTest_TestCaseSetUpFp)(void *arg)
Definition:
SDL_test_harness.h:64
SDLTest_TestSuiteReference::name
char * name
Definition:
SDL_test_harness.h:91
SDLTest_TestCaseReference::testCase
SDLTest_TestCaseFp testCase
Definition:
SDL_test_harness.h:77
SDLTest_TestCaseTearDownFp
void(* SDLTest_TestCaseTearDownFp)(void *arg)
Definition:
SDL_test_harness.h:70
SDLTest_TestCaseReference::description
char * description
Definition:
SDL_test_harness.h:81
SDLTest_RunSuites
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.
length
GLuint GLsizei GLsizei * length
Definition:
SDL_opengl_glext.h:672
close_code.h
filter
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition:
SDL_opengl_glext.h:1187
begin_code.h
SDLTest_TestSuiteReference::testTearDown
SDLTest_TestCaseTearDownFp testTearDown
Definition:
SDL_test_harness.h:97
SDLTest_TestCaseFp
int(* SDLTest_TestCaseFp)(void *arg)
Definition:
SDL_test_harness.h:67
SDLTest_TestCaseReference
struct SDLTest_TestCaseReference SDLTest_TestCaseReference
SDLTest_TestCaseReference
Definition:
SDL_test_harness.h:75
SDLTest_TestSuiteReference::testSetUp
SDLTest_TestCaseSetUpFp testSetUp
Definition:
SDL_test_harness.h:93
SDLTest_TestSuiteReference::testCases
const SDLTest_TestCaseReference ** testCases
Definition:
SDL_test_harness.h:95
void
typedef void(SDLCALL *SDL_AudioFilter)(struct SDL_AudioCVT *cvt
SDLTest_GenerateRunSeed
char * SDLTest_GenerateRunSeed(const int length)
Generates a random run seed string for the harness. The generated seed will contain alphanumeric char...
Uint64
uint64_t Uint64
Definition:
SDL_stdinc.h:216
SDLTest_TestSuiteReference
struct SDLTest_TestSuiteReference SDLTest_TestSuiteReference
SDLTest_TestCaseReference::name
char * name
Definition:
SDL_test_harness.h:79
SDLTest_TestSuiteReference
Definition:
SDL_test_harness.h:89
SDLTest_TestCaseReference::enabled
int enabled
Definition:
SDL_test_harness.h:83
lib
win32
x86
sdl2-2.0.12
include
SDL_test_harness.h
Документация по World of Might and Magic. Последние изменения: Вт 7 Апр 2020 22:03:44. Создано системой
1.8.17