|
1 /* See COPYING.txt for the full license governing this code. */ |
|
2 /** |
|
3 * \file SDL_visualtest_variators.h |
|
4 * |
|
5 * Header for all the variators that vary input parameters to a SUT application. |
|
6 */ |
|
7 |
|
8 #include "SDL_visualtest_exhaustive_variator.h" |
|
9 #include "SDL_visualtest_random_variator.h" |
|
10 |
|
11 #ifndef _SDL_visualtest_variators_h |
|
12 #define _SDL_visualtest_variators_h |
|
13 |
|
14 /* Set up for C function definitions, even when using C++ */ |
|
15 #ifdef __cplusplus |
|
16 extern "C" { |
|
17 #endif |
|
18 |
|
19 /** |
|
20 * Struct that acts like a wrapper around the different types of variators |
|
21 * available. |
|
22 */ |
|
23 typedef struct SDLVisualTest_Variator |
|
24 { |
|
25 /*! Type of the variator */ |
|
26 SDLVisualTest_VariatorType type; |
|
27 /*! union object that stores the variator */ |
|
28 union |
|
29 { |
|
30 SDLVisualTest_ExhaustiveVariator exhaustive; |
|
31 SDLVisualTest_RandomVariator random; |
|
32 } data; |
|
33 } SDLVisualTest_Variator; |
|
34 |
|
35 /** |
|
36 * Initializes the variator object pointed to by \c variator of type \c type |
|
37 * with information from the config object pointed to by \c config. |
|
38 * |
|
39 * \return 1 on success, 0 on failure |
|
40 */ |
|
41 int SDLVisualTest_InitVariator(SDLVisualTest_Variator* variator, |
|
42 SDLVisualTest_SUTConfig* config, |
|
43 SDLVisualTest_VariatorType type, |
|
44 Uint64 seed); |
|
45 |
|
46 /** |
|
47 * Gets the next variation using the variator. |
|
48 * |
|
49 * \return The arguments string representing the variation on success, and |
|
50 * NULL on failure. The pointer returned should not be freed. |
|
51 */ |
|
52 char* SDLVisualTest_GetNextVariation(SDLVisualTest_Variator* variator); |
|
53 |
|
54 /** |
|
55 * Frees any resources associated with the variator. |
|
56 */ |
|
57 void SDLVisualTest_FreeVariator(SDLVisualTest_Variator* variator); |
|
58 |
|
59 /* Ends C function definitions when using C++ */ |
|
60 #ifdef __cplusplus |
|
61 } |
|
62 #endif |
|
63 |
|
64 #endif /* _SDL_visualtest_variators_h */ |