1 /* See COPYING.txt for the full license governing this code. */
3 * \file SDL_visualtest_exhaustive_variator.h
5 * Header for the exhaustive variator.
8 #include "SDL_visualtest_harness_argparser.h"
9 #include "SDL_visualtest_variator_common.h"
11 #ifndef _SDL_visualtest_exhaustive_variator_h
12 #define _SDL_visualtest_exhaustive_variator_h
14 /* Set up for C function definitions, even when using C++ */
20 * Struct for the variator that exhaustively iterates through all variations of
21 * command line arguments to the SUT.
23 typedef struct SDLVisualTest_ExhaustiveVariator
25 /*! The current variation. */
26 SDLVisualTest_Variation variation;
27 /*! Configuration object for the SUT that the variator is running for. */
28 SDLVisualTest_SUTConfig config;
29 /*! Buffer to store the arguments string built from the variation */
30 char buffer[MAX_SUT_ARGS_LEN];
31 } SDLVisualTest_ExhaustiveVariator;
34 * Initializes the variator.
36 * \return 1 on success, 0 on failure
38 int SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator,
39 SDLVisualTest_SUTConfig* config);
42 * Gets the arguments string for the next variation using the variator and updates
43 * the variator's current variation object to the next variation.
45 * \return The arguments string representing the next variation on success, and
46 * NULL on failure or if we have iterated through all possible variations.
47 * In the latter case subsequent calls will start the variations again from
48 * the very beginning. The pointer returned should not be freed.
50 char* SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator);
53 * Frees any resources associated with the variator.
55 void SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator);
57 /* Ends C function definitions when using C++ */
62 #endif /* _SDL_visualtest_exhaustive_variator_h */