summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2015-07-24 01:06:40 +0000
committerKostya Serebryany <kcc@google.com>2015-07-24 01:06:40 +0000
commit404c69f2c8c7f7d4993f80fb1f7390571ffe56b6 (patch)
tree6396616273d6126f80ca341473538f9720740094 /llvm/lib/Fuzzer/test/FuzzerUnittest.cpp
parent636cd262d6ae996e76faba51e24eccb603e7e42f (diff)
downloadbcm5719-llvm-404c69f2c8c7f7d4993f80fb1f7390571ffe56b6.tar.gz
bcm5719-llvm-404c69f2c8c7f7d4993f80fb1f7390571ffe56b6.zip
[libFuzzer] allow users to supply their own implementation of rand
llvm-svn: 243078
Diffstat (limited to 'llvm/lib/Fuzzer/test/FuzzerUnittest.cpp')
-rw-r--r--llvm/lib/Fuzzer/test/FuzzerUnittest.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp b/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp
index 50f2f99760e..ed52a55a507 100644
--- a/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp
+++ b/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp
@@ -10,6 +10,7 @@ extern "C" void LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
TEST(Fuzzer, CrossOver) {
using namespace fuzzer;
+ FuzzerRandomLibc Rand(0);
Unit A({0, 1, 2}), B({5, 6, 7});
Unit C;
Unit Expected[] = {
@@ -53,7 +54,7 @@ TEST(Fuzzer, CrossOver) {
for (int Iter = 0; Iter < 3000; Iter++) {
C.resize(Len);
size_t NewSize = CrossOver(A.data(), A.size(), B.data(), B.size(),
- C.data(), C.size());
+ C.data(), C.size(), Rand);
C.resize(NewSize);
FoundUnits.insert(C);
}
OpenPOWER on IntegriCloud