Atlas - SDL_visualtest_random_variator.h
Home / ext / SDL2 / visualtest / include Lines: 1 | Size: 1742 bytes [Download] [Show on GitHub] [Search similar files] [Raw] [Raw (proxy)][FILE BEGIN]1/* See COPYING.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 8#include "SDL_visualtest_harness_argparser.h" 9#include "SDL_visualtest_variator_common.h" 10 11#ifndef SDL_visualtest_random_variator_h_ 12#define SDL_visualtest_random_variator_h_ 13 14/* Set up for C function definitions, even when using C++ */ 15#ifdef __cplusplus 16extern "C" { 17#endif 18 19/** 20 * Struct for the variator that randomly generates variations of command line 21 * arguments to the SUT. 22 */ 23typedef struct SDLVisualTest_RandomVariator 24{ 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_RandomVariator; 32 33/** 34 * Initializes the variator. 35 * 36 * \return 1 on success, 0 on failure 37 */ 38int SDLVisualTest_InitRandomVariator(SDLVisualTest_RandomVariator* variator, 39 SDLVisualTest_SUTConfig* config, Uint64 seed); 40 41/** 42 * Generates a new random variation. 43 * 44 * \return The arguments string representing the random variation on success, and 45 * NULL on failure. The pointer returned should not be freed. 46 */ 47char* SDLVisualTest_GetNextRandomVariation(SDLVisualTest_RandomVariator* variator); 48 49/** 50 * Frees any resources associated with the variator. 51 */ 52void SDLVisualTest_FreeRandomVariator(SDLVisualTest_RandomVariator* variator); 53 54/* Ends C function definitions when using C++ */ 55#ifdef __cplusplus 56} 57#endif 58 59#endif /* SDL_visualtest_random_variator_h_ */ 60 61/* vi: set ts=4 sw=4 expandtab: */ 62[FILE END](C) 2025 0x4248 (C) 2025 4248 Media and 4248 Systems, All part of 0x4248 See LICENCE files for more information. Not all files are by 0x4248 always check Licencing.