diff options
author | iphydf <iphydf@users.noreply.github.com> | 2016-10-01 00:26:52 +0100 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2016-10-01 02:13:34 +0100 |
commit | c037100747a1a224160cb12defb600ddfe1ba927 (patch) | |
tree | 8332a7d288116b802866e1ed98d1b950425206f7 /testing/hstox/fuzz_main.c | |
parent | 1977d56caaff40ea9bbf6754b69bec9539a5a969 (diff) |
Import the hstox SUT interface from hstox.
We'll maintain it in the c-toxcore repo, where it belongs.
Diffstat (limited to 'testing/hstox/fuzz_main.c')
-rw-r--r-- | testing/hstox/fuzz_main.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/hstox/fuzz_main.c b/testing/hstox/fuzz_main.c new file mode 100644 index 00000000..ff66a166 --- /dev/null +++ b/testing/hstox/fuzz_main.c | |||
@@ -0,0 +1,23 @@ | |||
1 | #include "driver.h" | ||
2 | |||
3 | #include <unistd.h> | ||
4 | |||
5 | // The number of afl iterations before terminating the process and starting a | ||
6 | // new one. | ||
7 | // See https://github.com/mcarpenter/afl/blob/master/llvm_mode/README.llvm. | ||
8 | #define ITERATIONS 1000 | ||
9 | |||
10 | #ifdef __GLASGOW_HASKELL__ | ||
11 | #define main fuzz_main | ||
12 | #endif | ||
13 | int main(int argc, char **argv) | ||
14 | { | ||
15 | struct settings cfg = {false, false}; | ||
16 | #ifdef __AFL_LOOP | ||
17 | |||
18 | while (__AFL_LOOP(ITERATIONS)) | ||
19 | #endif | ||
20 | communicate(cfg, STDIN_FILENO, STDOUT_FILENO); | ||
21 | |||
22 | return 0; | ||
23 | } | ||