Adding elementary support for fuzzing.

New options: --seed [VALUE] --exec-key [EXEC-KEY] --iterations VALUE
This commit is contained in:
Markus Kauppila 2011-07-24 18:21:53 +03:00
parent f1e162b811
commit afbf90dc78
11 changed files with 207 additions and 52 deletions

View file

@ -23,6 +23,7 @@
#include <time.h>
#include "logger.h"
#include "fuzzer/fuzzer.h"
#include "SDL_test.h"
@ -36,8 +37,13 @@ int _testAssertsFailed;
int _testAssertsPassed;
void
_InitTestEnvironment()
_InitTestEnvironment(const int execKey)
{
// The execKey gets corrupted while passing arguments
// hence the global variable to circumvent the problem
InitFuzzer(globalExecKey);
_testReturnValue = TEST_RESULT_PASS;
_testAssertsFailed = 0;
_testAssertsPassed = 0;
@ -53,6 +59,8 @@ _QuitTestEnvironment()
_testReturnValue = TEST_RESULT_NO_ASSERT;
}
DeinitFuzzer();
return _testReturnValue;
}
@ -61,6 +69,7 @@ _CountFailedAsserts() {
return _testAssertsFailed;
}
void
AssertEquals(int expected, int actual, char *message, ...)
{