SDL_visualtest_random_variator.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* See LICENSE.txt for the full license governing this code. */
  2. /**
  3. * \file SDL_visualtest_random_variator.h
  4. *
  5. * Header for the random variator.
  6. */
  7. #include "SDL_visualtest_harness_argparser.h"
  8. #include "SDL_visualtest_variator_common.h"
  9. #ifndef SDL_visualtest_random_variator_h_
  10. #define SDL_visualtest_random_variator_h_
  11. /* Set up for C function definitions, even when using C++ */
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /**
  16. * Struct for the variator that randomly generates variations of command line
  17. * arguments to the SUT.
  18. */
  19. typedef struct SDLVisualTest_RandomVariator
  20. {
  21. /*! The current variation. */
  22. SDLVisualTest_Variation variation;
  23. /*! Configuration object for the SUT that the variator is running for. */
  24. SDLVisualTest_SUTConfig config;
  25. /*! Buffer to store the arguments string built from the variation */
  26. char buffer[MAX_SUT_ARGS_LEN];
  27. } SDLVisualTest_RandomVariator;
  28. /**
  29. * Initializes the variator.
  30. *
  31. * \return 1 on success, 0 on failure
  32. */
  33. int SDLVisualTest_InitRandomVariator(SDLVisualTest_RandomVariator* variator,
  34. SDLVisualTest_SUTConfig* config, Uint64 seed);
  35. /**
  36. * Generates a new random variation.
  37. *
  38. * \return The arguments string representing the random variation on success, and
  39. * NULL on failure. The pointer returned should not be freed.
  40. */
  41. char* SDLVisualTest_GetNextRandomVariation(SDLVisualTest_RandomVariator* variator);
  42. /**
  43. * Frees any resources associated with the variator.
  44. */
  45. void SDLVisualTest_FreeRandomVariator(SDLVisualTest_RandomVariator* variator);
  46. /* Ends C function definitions when using C++ */
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50. #endif /* SDL_visualtest_random_variator_h_ */
  51. /* vi: set ts=4 sw=4 expandtab: */