diff options
author | Mike Aizatsky <aizatsky@chromium.org> | 2016-05-25 21:00:17 +0000 |
---|---|---|
committer | Mike Aizatsky <aizatsky@chromium.org> | 2016-05-25 21:00:17 +0000 |
commit | e66846ab3208cf7451a969c3896066ee81452636 (patch) | |
tree | 8f29a524a7043620b46517aea6152b3d0333b766 /llvm/lib/Fuzzer/test/FuzzerUnittest.cpp | |
parent | bfc1a469d5f35cc182c79c9d1c9cb8b611849a72 (diff) | |
download | bcm5719-llvm-e66846ab3208cf7451a969c3896066ee81452636.tar.gz bcm5719-llvm-e66846ab3208cf7451a969c3896066ee81452636.zip |
[libfuzzer] replacing unittest for truncate_units with functional test.
Differential Revision: http://reviews.llvm.org/D20641
llvm-svn: 270755
Diffstat (limited to 'llvm/lib/Fuzzer/test/FuzzerUnittest.cpp')
-rw-r--r-- | llvm/lib/Fuzzer/test/FuzzerUnittest.cpp | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp b/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp index 66e9285eb05..7b49f2f08e4 100644 --- a/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp +++ b/llvm/lib/Fuzzer/test/FuzzerUnittest.cpp @@ -13,10 +13,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { abort(); } -static int EmptyLLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - return 0; -} - TEST(Fuzzer, CrossOver) { Random Rand(0); MutationDispatcher MD(Rand); @@ -427,21 +423,3 @@ TEST(Corpus, Distribution) { EXPECT_GT(Hist[i], TriesPerUnit / N / 3); } } - -TEST(Corpus, TruncateUnits) { - Random Rand(0); - MutationDispatcher MD(Rand); - Fuzzer::FuzzingOptions Options; - Options.OutputCorpus = ""; // stops from writing new units. - Fuzzer Fuzz(EmptyLLVMFuzzerTestOneInput, MD, Options); - - Fuzz.AddToCorpus(Unit(1024, static_cast<uint8_t>(1))); - Fuzz.ResetCoverage(); - - std::vector<Unit> NewCorpus; - Fuzz.TruncateUnits(&NewCorpus); - - // New corpus should have a shorter unit. - EXPECT_EQ(1ul, NewCorpus.size()); - EXPECT_EQ(1ul, NewCorpus[0].size()); -} |