llvm.org GIT mirror llvm / 1c5866f
[libFuzzer] Update tests to use more general functions instead of posix specific. Replace sleep() posix function by a more portable sleep_for() function from std. Also, ignore memmem() and strcasestr() on Windows. Differential Revision: https://reviews.llvm.org/D27729 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289964 91177308-0d34-0410-b5e6-96231b3b80d8 Marcos Pividori 3 years ago
2 changed file(s) with 8 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
77 #include
88 #include
99 #include
10 #include
1011 #include
1112
1213 static volatile char *SinkPtr;
2021 char *p = new char[kSize];
2122 memset(p, 0, kSize);
2223 SinkPtr = p;
23 sleep(1);
24 std::this_thread::sleep_for(std::chrono::seconds(1));
2425 }
2526 }
2627 }
66 #include
77 #include
88 #include
9
10 // Windows does not have strcasestr and memmem, so we are not testing them.
11 #ifdef _WIN32
12 #define strcasestr strstr
13 #define memmem(a, b, c, d) true
14 #endif
915
1016 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
1117 if (Size < 4) return 0;