SDL Visual Test
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
SDL_visualtest_variator_common.h File Reference
#include <SDL_types.h>
#include "SDL_visualtest_sut_configparser.h"

Go to the source code of this file.

Data Structures

union  SDLVisualTest_SUTOptionValue
 
struct  SDLVisualTest_Variation
 

Macros

#define SDL_SUT_INTEGER_OPTION_TEST_STEPS   3
 

Typedefs

typedef enum
SDLVisualTest_VariatorType 
SDLVisualTest_VariatorType
 
typedef union
SDLVisualTest_SUTOptionValue 
SDLVisualTest_SUTOptionValue
 
typedef struct
SDLVisualTest_Variation 
SDLVisualTest_Variation
 

Enumerations

enum  SDLVisualTest_VariatorType { SDL_VARIATOR_NONE = 0, SDL_VARIATOR_EXHAUSTIVE, SDL_VARIATOR_RANDOM }
 

Functions

int SDLVisualTest_NextValue (SDLVisualTest_SUTOptionValue *var, SDLVisualTest_SUTOption *opt)
 
int SDLVisualTest_MakeStrFromVariation (SDLVisualTest_Variation *variation, SDLVisualTest_SUTConfig *config, char *buffer, int size)
 
int SDLVisualTest_InitVariation (SDLVisualTest_Variation *variation, SDLVisualTest_SUTConfig *config)
 

Detailed Description

Header for common functionality used by variators.

Macro Definition Documentation

#define SDL_SUT_INTEGER_OPTION_TEST_STEPS   3

The number of variations one integer option would generate

Typedef Documentation

One possible value for a command line option to the SUT.

Represents a valid combination of parameters that can be passed to the SUT. The ordering of the values here is the same as the ordering of the options in the SDLVisualTest_SUTConfig object for this variation.

enum for indicating the type of variator being used

Enumeration Type Documentation

enum for indicating the type of variator being used

Function Documentation

int SDLVisualTest_InitVariation ( SDLVisualTest_Variation variation,
SDLVisualTest_SUTConfig config 
)

Initializes the variation using the following rules:

  • Boolean options are initialized to SDL_FALSE.
  • Integer options are initialized to the minimum valid value they can hold.
  • Enum options are initialized to the first element in the list of values they can take.
  • String options are initialized to the name of the option.
Returns
1 on success, 0 on failure.
int SDLVisualTest_MakeStrFromVariation ( SDLVisualTest_Variation variation,
SDLVisualTest_SUTConfig config,
char *  buffer,
int  size 
)

Converts a variation object into a string of command line arguments.

Parameters
variationVariation object to be converted.
configConfig object for the SUT.
bufferPointer to the buffer the arguments string will be copied into.
sizeSize of the buffer.
Returns
1 on success, 0 on failure
int SDLVisualTest_NextValue ( SDLVisualTest_SUTOptionValue var,
SDLVisualTest_SUTOption opt 
)

"Increments" the value of the option by one and returns the carry. We wrap around to the initial value on overflow which makes the carry one. For example: "incrementing" an SDL_FALSE option makes it SDL_TRUE with no carry, and "incrementing" an SDL_TRUE option makes it SDL_FALSE with carry one. For integers, a random value in the valid range for the option is used.

Parameters
varValue of the option
optObject with metadata about the option
Returns
1 if there is a carry for enum and bool type options, 0 otherwise. 1 is always returned for integer and string type options. -1 is returned on error.