Skip to content

Commit

Permalink
mutator: fix a rare test case
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oetr authored and fmeum committed Apr 17, 2023
1 parent 26ab4ca commit 7e234b6
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e234b6

Please sign in to comment.