visualtest/include/SDL_visualtest_variators.h
changeset 7924 fcb86d323770
child 11382 2c50e79b19e0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/visualtest/include/SDL_visualtest_variators.h	Sun Nov 10 00:32:23 2013 -0500
     1.3 @@ -0,0 +1,64 @@
     1.4 +/* See COPYING.txt for the full license governing this code. */
     1.5 +/**
     1.6 + * \file SDL_visualtest_variators.h
     1.7 + *
     1.8 + * Header for all the variators that vary input parameters to a SUT application.
     1.9 + */
    1.10 +
    1.11 +#include "SDL_visualtest_exhaustive_variator.h"
    1.12 +#include "SDL_visualtest_random_variator.h"
    1.13 +
    1.14 +#ifndef _SDL_visualtest_variators_h
    1.15 +#define _SDL_visualtest_variators_h
    1.16 +
    1.17 +/* Set up for C function definitions, even when using C++ */
    1.18 +#ifdef __cplusplus
    1.19 +extern "C" {
    1.20 +#endif
    1.21 +
    1.22 +/**
    1.23 + * Struct that acts like a wrapper around the different types of variators
    1.24 + * available.
    1.25 + */
    1.26 +typedef struct SDLVisualTest_Variator
    1.27 +{
    1.28 +    /*! Type of the variator */
    1.29 +    SDLVisualTest_VariatorType type;
    1.30 +    /*! union object that stores the variator */
    1.31 +    union
    1.32 +    {
    1.33 +        SDLVisualTest_ExhaustiveVariator exhaustive;
    1.34 +        SDLVisualTest_RandomVariator random;
    1.35 +    } data;
    1.36 +} SDLVisualTest_Variator;
    1.37 +
    1.38 +/**
    1.39 + * Initializes the variator object pointed to by \c variator of type \c type
    1.40 + * with information from the config object pointed to by \c config.
    1.41 + *
    1.42 + * \return 1 on success, 0 on failure
    1.43 + */
    1.44 +int SDLVisualTest_InitVariator(SDLVisualTest_Variator* variator,
    1.45 +                               SDLVisualTest_SUTConfig* config,
    1.46 +                               SDLVisualTest_VariatorType type,
    1.47 +                               Uint64 seed);
    1.48 +
    1.49 +/**
    1.50 + * Gets the next variation using the variator.
    1.51 + *
    1.52 + * \return The arguments string representing the variation on success, and
    1.53 + *         NULL on failure. The pointer returned should not be freed.
    1.54 + */
    1.55 +char* SDLVisualTest_GetNextVariation(SDLVisualTest_Variator* variator);
    1.56 +
    1.57 +/**
    1.58 + * Frees any resources associated with the variator.
    1.59 + */
    1.60 +void SDLVisualTest_FreeVariator(SDLVisualTest_Variator* variator);
    1.61 +
    1.62 +/* Ends C function definitions when using C++ */
    1.63 +#ifdef __cplusplus
    1.64 +}
    1.65 +#endif
    1.66 +
    1.67 +#endif /* _SDL_visualtest_variators_h */
    1.68 \ No newline at end of file