aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorFabian Meumertzheim <meumertzheim@code-intelligence.com>2023-03-27 16:24:52 +0200
committerFabian Meumertzheim <fabian@meumertzhe.im>2023-03-28 15:47:44 +0200
commit681b429b2225330acdb936f4eb8f36049e9bba1a (patch)
treed4cd52e78f574bcee7c240ffac59d00311c9fe17 /src/test
parentede65fbef5a92f9ff1ee41e57d257a92901cdf60 (diff)
downloadjazzer-api-681b429b2225330acdb936f4eb8f36049e9bba1a.tar.gz
mutator: Use shorter initial sizes for byte arrays
Without this change, the simple new fuzz test fails to find the planted bug. With this change, it finds it in less than 20,000 runs.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/code_intelligence/jazzer/mutation/mutator/StressTest.java5
-rw-r--r--src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BUILD.bazel5
2 files changed, 7 insertions, 3 deletions
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 ef2b52cb..1039e2c2 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
@@ -108,7 +108,8 @@ public class StressTest {
new TypeHolder<@NotNull Map<@NotNull String, @NotNull String>>() {}.annotatedType(),
"Map<String,String>", distinctElementsRatio(0.45), distinctElementsRatio(0.45)),
arguments(new TypeHolder<Map<@NotNull String, @NotNull String>>() {}.annotatedType(),
- "Nullable<Map<String,String>>", manyDistinctElements(), manyDistinctElements()),
+ "Nullable<Map<String,String>>", distinctElementsRatio(0.48),
+ distinctElementsRatio(0.48)),
arguments(
new TypeHolder<@WithSize(
min = 1, max = 3) @NotNull Map<@NotNull Integer, @NotNull Integer>>() {
@@ -225,7 +226,7 @@ public class StressTest {
EnumFieldRepeated3.newBuilder().addSomeField(TestEnumRepeated.VAL2).build()),
manyDistinctElements()),
arguments(new TypeHolder<@NotNull MapField3>() {}.annotatedType(),
- "{Builder.Map<Integer,String>} -> Message", distinctElementsRatio(0.49),
+ "{Builder.Map<Integer,String>} -> Message", distinctElementsRatio(0.475),
manyDistinctElements()),
arguments(new TypeHolder<@NotNull MessageMapField3>() {}.annotatedType(),
"{Builder.Map<String,{Builder.Map<Integer,String>} -> Message>} -> Message",
diff --git a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BUILD.bazel b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BUILD.bazel
index 53841b4e..b360a332 100644
--- a/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BUILD.bazel
+++ b/src/test/java/com/code_intelligence/jazzer/mutation/mutator/proto/BUILD.bazel
@@ -20,7 +20,10 @@ proto_library(
java_proto_library(
name = "proto2_java_proto",
testonly = True,
- visibility = ["//src/test/java/com/code_intelligence/jazzer/mutation/mutator:__pkg__"],
+ visibility = [
+ "//src/test/java/com/code_intelligence/jazzer/mutation/mutator:__pkg__",
+ "//tests:__pkg__",
+ ],
deps = [":proto2_proto"],
)