aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com
diff options
context:
space:
mode:
authorFabian Meumertzheim <meumertzheim@code-intelligence.com>2023-03-23 08:37:14 +0100
committerFabian Meumertzheim <fabian@meumertzhe.im>2023-03-23 09:31:53 +0100
commite83a70d0184eb39038e53aa5c8d62c98cb6ca3c2 (patch)
treeede78c153fb91c9cf2a25444d0a57c39e7435330 /src/test/java/com
parent48c20608896a3e356469b8db6395e3adc7b8af10 (diff)
downloadjazzer-api-e83a70d0184eb39038e53aa5c8d62c98cb6ca3c2.tar.gz
mutator: Revert `fixedValue` back to `SerializingMutator`
`fixedValue` didn't behave correctly as a `SerializingInPlaceMutator` on a non-default value as it would not be able to ensure that the object given to `initInPlace` is indeed the fixed value - it just didn't change the object and thus only worked correctly for default instances. This reverts commits: * 81cc0bbcdae1471114a54e458790c2b1c60cc68b * bdd71b3dfdecf537ff355df5a32c92b7b44e8041 * 1605864822b519e7e241504472fd50605ceeb9aa
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BuilderMutatorProto3Test.java20
-rw-r--r--src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/proto3.proto2
2 files changed, 0 insertions, 22 deletions
diff --git a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BuilderMutatorProto3Test.java b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BuilderMutatorProto3Test.java
index 69de5104..cb54a146 100644
--- a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BuilderMutatorProto3Test.java
+++ b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BuilderMutatorProto3Test.java
@@ -28,7 +28,6 @@ import com.code_intelligence.jazzer.mutation.mutator.collection.CollectionMutato
import com.code_intelligence.jazzer.mutation.mutator.lang.LangMutators;
import com.code_intelligence.jazzer.mutation.support.TestSupport.MockPseudoRandom;
import com.code_intelligence.jazzer.mutation.support.TypeHolder;
-import com.code_intelligence.jazzer.protobuf.Proto3.EmptyMessage3;
import com.code_intelligence.jazzer.protobuf.Proto3.EnumField3;
import com.code_intelligence.jazzer.protobuf.Proto3.EnumField3.TestEnum;
import com.code_intelligence.jazzer.protobuf.Proto3.EnumFieldOne3;
@@ -483,23 +482,4 @@ class BuilderMutatorProto3Test {
.isEqualTo(OneOfField3.newBuilder().setOtherField(true).setYetAnotherField(true).build());
assertThat(builder.build().hasMessageField()).isFalse();
}
-
- @Test
- void testEmptyMessage3() {
- InPlaceMutator<EmptyMessage3.Builder> mutator =
- (InPlaceMutator<EmptyMessage3.Builder>) FACTORY.createInPlaceOrThrow(
- new TypeHolder<EmptyMessage3.@NotNull Builder>() {}.annotatedType());
- assertThat(mutator.toString()).isEqualTo("FixedValue(EmptyMessage3.Builder())");
- EmptyMessage3.Builder builder = EmptyMessage3.newBuilder();
-
- try (MockPseudoRandom prng = mockPseudoRandom()) {
- mutator.initInPlace(builder, prng);
- }
- assertThat(builder.build()).isEqualTo(EmptyMessage3.getDefaultInstance());
-
- try (MockPseudoRandom prng = mockPseudoRandom()) {
- mutator.mutateInPlace(builder, prng);
- }
- assertThat(builder.build()).isEqualTo(EmptyMessage3.getDefaultInstance());
- }
}
diff --git a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/proto3.proto b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/proto3.proto
index 32451a7d..88003345 100644
--- a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/proto3.proto
+++ b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/proto3.proto
@@ -128,5 +128,3 @@ message DoubleField3 {
message RepeatedDoubleField3 {
repeated double some_field = 1;
}
-
-message EmptyMessage3 {}