SDL_visualtest_exhaustive_variator.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* See COPYING.txt for the full license governing this code. */
  2. /**
  3. * \file SDL_visualtest_exhaustive_variator.h
  4. *
  5. * Header for the exhaustive variator.
  6. */
  7. #include "SDL_visualtest_harness_argparser.h"
  8. #include "SDL_visualtest_variator_common.h"
  9. #ifndef _SDL_visualtest_exhaustive_variator_h
  10. #define _SDL_visualtest_exhaustive_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 exhaustively iterates through all variations of
  17. * command line arguments to the SUT.
  18. */
  19. typedef struct SDLVisualTest_ExhaustiveVariator
  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_ExhaustiveVariator;
  28. /**
  29. * Initializes the variator.
  30. *
  31. * \return 1 on success, 0 on failure
  32. */
  33. int SDLVisualTest_InitExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator,
  34. SDLVisualTest_SUTConfig* config);
  35. /**
  36. * Gets the arguments string for the next variation using the variator and updates
  37. * the variator's current variation object to the next variation.
  38. *
  39. * \return The arguments string representing the next variation on success, and
  40. * NULL on failure or if we have iterated through all possible variations.
  41. * In the latter case subsequent calls will start the variations again from
  42. * the very beginning. The pointer returned should not be freed.
  43. */
  44. char* SDLVisualTest_GetNextExhaustiveVariation(SDLVisualTest_ExhaustiveVariator* variator);
  45. /**
  46. * Frees any resources associated with the variator.
  47. */
  48. void SDLVisualTest_FreeExhaustiveVariator(SDLVisualTest_ExhaustiveVariator* variator);
  49. /* Ends C function definitions when using C++ */
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif /* _SDL_visualtest_exhaustive_variator_h */