[llvm] r272743 - [LibFuzzer] Fix ``FuzzerMutate.ShuffleBytes2`` unit test on OSX.

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 18:40:03 PDT 2016


Author: delcypher
Date: Tue Jun 14 20:40:02 2016
New Revision: 272743

URL: http://llvm.org/viewvc/llvm-project?rev=272743&view=rev
Log:
[LibFuzzer] Fix ``FuzzerMutate.ShuffleBytes2`` unit test on OSX.

The ``FuzzerMutate.ShuffleBytes2`` unit test was failing on
OSX due to the implementation of ``std::random_shuffle()``
being different between libcxx and libstdc++.

@kcc has decided (see http://reviews.llvm.org/D21218) it is acceptable
for there to be different mutation behavior on different platforms so
this commit just adjusts the test to perform the minimum number of
iterations (that is a power of 2) to see all the mutations the unit test
is looking for.

Differential Revision: http://reviews.llvm.org/D21359

Modified:
    llvm/trunk/lib/Fuzzer/test/FuzzerUnittest.cpp

Modified: llvm/trunk/lib/Fuzzer/test/FuzzerUnittest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/test/FuzzerUnittest.cpp?rev=272743&r1=272742&r2=272743&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/test/FuzzerUnittest.cpp (original)
+++ llvm/trunk/lib/Fuzzer/test/FuzzerUnittest.cpp Tue Jun 14 20:40:02 2016
@@ -259,7 +259,7 @@ TEST(FuzzerMutate, ShuffleBytes1) {
   TestShuffleBytes(&MutationDispatcher::Mutate_ShuffleBytes, 1 << 16);
 }
 TEST(FuzzerMutate, ShuffleBytes2) {
-  TestShuffleBytes(&MutationDispatcher::Mutate, 1 << 19);
+  TestShuffleBytes(&MutationDispatcher::Mutate, 1 << 20);
 }
 
 void TestAddWordFromDictionary(Mutator M, int NumIter) {




More information about the llvm-commits mailing list