Update SDL_InvalidParamError to take param name; add additional fuzzer function; add new tests to keyboard test suite; improve surface test suite

This commit is contained in:
Andreas Schiffler 2013-01-12 22:58:12 -08:00
parent c1e8384624
commit b4a190fb6f
10 changed files with 272 additions and 54 deletions

View file

@ -52,7 +52,7 @@ extern DECLSPEC void SDLCALL SDL_ClearError(void);
/*@{*/
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
#define SDL_InvalidParamError() SDL_Error(SDL_INVALIDPARAM)
#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
typedef enum
{
SDL_ENOMEM,
@ -60,7 +60,6 @@ typedef enum
SDL_EFWRITE,
SDL_EFSEEK,
SDL_UNSUPPORTED,
SDL_INVALIDPARAM,
SDL_LASTERROR
} SDL_errorcode;
extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);

View file

@ -329,30 +329,44 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
/**
* Generates random null-terminated string. The maximum length for
* the string is 255 characters and it can contain ASCII characters
* from 1 to 127.
* Generates random null-terminated string. The minimum length for
* the string is 1 character, maximum length for the string is 255
* characters and it can contain ASCII characters from 32 to 126.
*
* Note: Returned string needs to be deallocated.
*
* \returns newly allocated random string
* \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
*/
char * SDLTest_RandomAsciiString();
/**
* Generates random null-terminated string. The maximum length for
* the string is defined by maxLenght parameter.
* String can contain ASCII characters from 1 to 127.
* the string is defined by the maxLength parameter.
* String can contain ASCII characters from 32 to 126.
*
* Note: Returned string needs to be deallocated.
*
* \param maxLength Maximum length of the generated string
* \param maxLength The maximum length of the generated string.
*
* \returns newly allocated random string
* \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
*/
char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
/**
* Generates random null-terminated string. The length for
* the string is defined by the size parameter.
* String can contain ASCII characters from 32 to 126.
*
* Note: Returned string needs to be deallocated.
*
* \param size The length of the generated string
*
* \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
*/
char * SDLTest_RandomAsciiStringOfSize(int size);
/**
* Returns the invocation count for the fuzzer since last ...FuzzerInit.
*/