From 7e234b6e73200253eaf2069ad0ad57b7db4e212d Mon Sep 17 00:00:00 2001 From: Peter Samarin Date: Mon, 17 Apr 2023 15:16:09 +0200 Subject: [PATCH] mutator: fix a rare test case The rare case happens for proto float/double fields that are initiated with -0.0/-0.0f; detached to 0.0/0.0f; and mutated back to -0.0/-0.0f. This previously caused a rare random failure of the StressTest.java. --- .../code_intelligence/jazzer/mutation/mutator/StressTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java index 05fe573e4..19aed4f12 100644 --- a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java +++ b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java @@ -456,6 +456,7 @@ void genericMutatorStressTest(AnnotatedType type, String mutatorTree, testReadWriteExclusiveRoundtrip(mutator, fixedValue); initValues.add(mutator.detach(value)); + value = fixFloatingPointsForProtos(value); for (int mutation = 0; mutation < NUM_MUTATE_PER_INIT; mutation++) { Object detachedOldValue = mutator.detach(value);