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