diff options
author | OszkarSemerath <semerath@mit.bme.hu> | 2023-02-05 20:05:04 +0100 |
---|---|---|
committer | OszkarSemerath <semerath@mit.bme.hu> | 2023-02-05 20:05:35 +0100 |
commit | 8403277d0a967f234c46f09cf54185ce3ed01c8b (patch) | |
tree | c3256fd21867bb26832af25bbb4b7bd645e61567 | |
parent | fixup! Performance improvements by replacing hash depth calculation with shif... (diff) | |
download | refinery-8403277d0a967f234c46f09cf54185ce3ed01c8b.tar.gz refinery-8403277d0a967f234c46f09cf54185ce3ed01c8b.tar.zst refinery-8403277d0a967f234c46f09cf54185ce3ed01c8b.zip |
Extending map tests with null as default value.
10 files changed, 139 insertions, 109 deletions
diff --git a/subprojects/store/src/jmh/java/tools/refinery/store/map/benchmarks/ImmutablePutExecutionPlan.java b/subprojects/store/src/jmh/java/tools/refinery/store/map/benchmarks/ImmutablePutExecutionPlan.java index 756d504e..5484f115 100644 --- a/subprojects/store/src/jmh/java/tools/refinery/store/map/benchmarks/ImmutablePutExecutionPlan.java +++ b/subprojects/store/src/jmh/java/tools/refinery/store/map/benchmarks/ImmutablePutExecutionPlan.java | |||
@@ -35,7 +35,7 @@ public class ImmutablePutExecutionPlan { | |||
35 | @Setup(Level.Trial) | 35 | @Setup(Level.Trial) |
36 | public void setUpTrial() { | 36 | public void setUpTrial() { |
37 | random = new Random(); | 37 | random = new Random(); |
38 | values = MapTestEnvironment.prepareValues(nValues); | 38 | values = MapTestEnvironment.prepareValues(nValues, true); |
39 | } | 39 | } |
40 | 40 | ||
41 | public VersionedMapImpl<Integer, String> createSut() { | 41 | public VersionedMapImpl<Integer, String> createSut() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java index 1f9d022f..c872b9da 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/CommitFuzzTest.java | |||
@@ -19,9 +19,10 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
20 | 20 | ||
21 | class CommitFuzzTest { | 21 | class CommitFuzzTest { |
22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
23 | boolean evilHash) { | 23 | boolean nullDefault, int commitFrequency, |
24 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 24 | boolean evilHash) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue,nullDefault); | ||
25 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 26 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
26 | 27 | ||
27 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 28 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
@@ -64,30 +65,33 @@ class CommitFuzzTest { | |||
64 | } | 65 | } |
65 | } | 66 | } |
66 | 67 | ||
67 | @ParameterizedTest(name = "Commit {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 68 | @ParameterizedTest(name = "Commit {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit frequency={5} " + |
69 | "seed={6} evil-hash={7}") | ||
68 | @MethodSource | 70 | @MethodSource |
69 | @Timeout(value = 10) | 71 | @Timeout(value = 10) |
70 | @Tag("fuzz") | 72 | @Tag("fuzz") |
71 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 73 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
72 | boolean evilHash) { | 74 | int seed, |
75 | boolean evilHash) { | ||
73 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 76 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
74 | commitFrequency, evilHash); | 77 | nullDefault, commitFrequency, evilHash); |
75 | } | 78 | } |
76 | 79 | ||
77 | static Stream<Arguments> parametrizedFastFuzz() { | 80 | static Stream<Arguments> parametrizedFastFuzz() { |
78 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 81 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
79 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 82 | new Object[] { 2, 3 }, new Object[]{false,true}, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
80 | new Object[] { false, true }); | 83 | new Object[] { false, true }); |
81 | } | 84 | } |
82 | 85 | ||
83 | @ParameterizedTest(name = "Commit {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 86 | @ParameterizedTest(name = "Commit {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit frequency={5} " + |
87 | "seed={6} evil-hash={7}") | ||
84 | @MethodSource | 88 | @MethodSource |
85 | @Tag("fuzz") | 89 | @Tag("fuzz") |
86 | @Tag("slow") | 90 | @Tag("slow") |
87 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 91 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
88 | boolean evilHash) { | 92 | int seed, boolean evilHash) { |
89 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 93 | runFuzzTest("CommitS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
90 | commitFrequency, evilHash); | 94 | nullDefault, commitFrequency, evilHash); |
91 | } | 95 | } |
92 | 96 | ||
93 | static Stream<Arguments> parametrizedSlowFuzz() { | 97 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java index 93ecfec3..a5a68b94 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/ContentEqualsFuzzTest.java | |||
@@ -20,9 +20,10 @@ import java.util.stream.Stream; | |||
20 | import static org.junit.jupiter.api.Assertions.*; | 20 | import static org.junit.jupiter.api.Assertions.*; |
21 | 21 | ||
22 | class ContentEqualsFuzzTest { | 22 | class ContentEqualsFuzzTest { |
23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
24 | boolean nullDefault, int commitFrequency, | ||
24 | boolean evilHash) { | 25 | boolean evilHash) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
26 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 27 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
27 | 28 | ||
28 | Random r = new Random(seed); | 29 | Random r = new Random(seed); |
@@ -80,33 +81,33 @@ class ContentEqualsFuzzTest { | |||
80 | MapTestEnvironment.compareTwoMaps(scenario, sut1, sut2); | 81 | MapTestEnvironment.compareTwoMaps(scenario, sut1, sut2); |
81 | } | 82 | } |
82 | 83 | ||
83 | @ParameterizedTest(name = "Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} " + | 84 | @ParameterizedTest(name = "Compare {index}/{0} Steps={1} Keys={2} Values={3} defaultNull={4} commit frequency={5}" + |
84 | "evil-hash={6}") | 85 | "seed={6} evil-hash={7}") |
85 | @MethodSource | 86 | @MethodSource |
86 | @Timeout(value = 10) | 87 | @Timeout(value = 10) |
87 | @Tag("fuzz") | 88 | @Tag("fuzz") |
88 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 89 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
89 | boolean evilHash) { | 90 | int seed, boolean evilHash) { |
90 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 91 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
91 | commitFrequency, evilHash); | 92 | nullDefault, commitFrequency, evilHash); |
92 | } | 93 | } |
93 | 94 | ||
94 | static Stream<Arguments> parametrizedFastFuzz() { | 95 | static Stream<Arguments> parametrizedFastFuzz() { |
95 | return FuzzTestUtils.permutationWithSize(new Object[]{FuzzTestUtils.FAST_STEP_COUNT}, new Object[]{3, 32, | 96 | return FuzzTestUtils.permutationWithSize(new Object[]{FuzzTestUtils.FAST_STEP_COUNT}, new Object[]{3, 32, |
96 | 32 * 32}, | 97 | 32 * 32}, |
97 | new Object[]{2, 3}, new Object[]{1, 10, 100}, new Object[]{1, 2, 3}, | 98 | new Object[]{2, 3}, new Object[]{false,true}, new Object[]{1, 10, 100}, new Object[]{1, 2, 3}, |
98 | new Object[]{false, true}); | 99 | new Object[]{false, true}); |
99 | } | 100 | } |
100 | 101 | ||
101 | @ParameterizedTest(name = "Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} " + | 102 | @ParameterizedTest(name = "Compare {index}/{0} Steps={1} Keys={2} Values={3} defaultNull={4} commit frequency={5}" + |
102 | "evil-hash={6}") | 103 | "seed={6} evil-hash={7}") |
103 | @MethodSource | 104 | @MethodSource |
104 | @Tag("fuzz") | 105 | @Tag("fuzz") |
105 | @Tag("slow") | 106 | @Tag("slow") |
106 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 107 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean defaultNull, int commitFrequency, |
107 | boolean evilHash) { | 108 | int seed, boolean evilHash) { |
108 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 109 | runFuzzTest("CompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
109 | commitFrequency, evilHash); | 110 | defaultNull, commitFrequency, evilHash); |
110 | } | 111 | } |
111 | 112 | ||
112 | static Stream<Arguments> parametrizedSlowFuzz() { | 113 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java index e6334224..670b5445 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/DiffCursorFuzzTest.java | |||
@@ -20,17 +20,18 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
20 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 20 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
21 | 21 | ||
22 | class DiffCursorFuzzTest { | 22 | class DiffCursorFuzzTest { |
23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 23 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
24 | boolean nullDefault, int commitFrequency, | ||
24 | boolean evilHash) { | 25 | boolean evilHash) { |
25 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
26 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 27 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
27 | 28 | ||
28 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 29 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
29 | iterativeRandomPutsAndCommitsThenDiffcursor(scenario, store, steps, maxKey, values, seed, commitFrequency); | 30 | iterativeRandomPutsAndCommitsThenDiffCursor(scenario, store, steps, maxKey, values, seed, commitFrequency); |
30 | } | 31 | } |
31 | 32 | ||
32 | private void iterativeRandomPutsAndCommitsThenDiffcursor(String scenario, VersionedMapStore<Integer, String> store, | 33 | private void iterativeRandomPutsAndCommitsThenDiffCursor(String scenario, VersionedMapStore<Integer, String> store, |
33 | int steps, int maxKey, String[] values, int seed, int commitFrequency) { | 34 | int steps, int maxKey, String[] values, int seed, int commitFrequency) { |
34 | // 1. build a map with versions | 35 | // 1. build a map with versions |
35 | Random r = new Random(seed); | 36 | Random r = new Random(seed); |
36 | VersionedMapImpl<Integer, String> versioned = (VersionedMapImpl<Integer, String>) store.createMap(); | 37 | VersionedMapImpl<Integer, String> versioned = (VersionedMapImpl<Integer, String>) store.createMap(); |
@@ -86,29 +87,33 @@ class DiffCursorFuzzTest { | |||
86 | 87 | ||
87 | } | 88 | } |
88 | 89 | ||
89 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 90 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} " + |
91 | "commit frequency={5} seed={6} evil-hash={7}") | ||
90 | @MethodSource | 92 | @MethodSource |
91 | @Timeout(value = 10) | 93 | @Timeout(value = 10) |
92 | @Tag("fuzz") | 94 | @Tag("fuzz") |
93 | void parametrizedFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 95 | void parametrizedFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
96 | int seed, | ||
94 | boolean evilHash) { | 97 | boolean evilHash) { |
95 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, | 98 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, |
96 | noKeys, noValues, commitFrequency, evilHash); | 99 | noKeys, noValues, nullDefault, commitFrequency, evilHash); |
97 | } | 100 | } |
98 | 101 | ||
99 | static Stream<Arguments> parametrizedFuzz() { | 102 | static Stream<Arguments> parametrizedFuzz() { |
100 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 103 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
101 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 104 | new Object[] { 2, 3 }, new Object[]{false,true}, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
102 | new Object[] { false, true }); | 105 | new Object[] { false, true }); |
103 | } | 106 | } |
104 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 107 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} " + |
108 | "commit frequency={5} seed={6} evil-hash={7}") | ||
105 | @MethodSource | 109 | @MethodSource |
106 | @Tag("fuzz") | 110 | @Tag("fuzz") |
107 | @Tag("slow") | 111 | @Tag("slow") |
108 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 112 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
113 | int seed, | ||
109 | boolean evilHash) { | 114 | boolean evilHash) { |
110 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 115 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
111 | commitFrequency, evilHash); | 116 | nullDefault, commitFrequency, evilHash); |
112 | } | 117 | } |
113 | 118 | ||
114 | static Stream<Arguments> parametrizedSlowFuzz() { | 119 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java index 1ab431a8..d8e1a30f 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MultiThreadFuzzTest.java | |||
@@ -22,31 +22,32 @@ import tools.refinery.store.map.tests.utils.MapTestEnvironment; | |||
22 | 22 | ||
23 | class MultiThreadFuzzTest { | 23 | class MultiThreadFuzzTest { |
24 | public static final int noThreads = 32; | 24 | public static final int noThreads = 32; |
25 | 25 | ||
26 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 26 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
27 | boolean evilHash) { | 27 | boolean nullDefault, int commitFrequency, |
28 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 28 | boolean evilHash) { |
29 | String[] values = MapTestEnvironment.prepareValues(maxValue,nullDefault); | ||
29 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 30 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
30 | 31 | ||
31 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 32 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
32 | 33 | ||
33 | // initialize runnables | 34 | // initialize runnables |
34 | MultiThreadTestRunnable[] runnables = new MultiThreadTestRunnable[noThreads]; | 35 | MultiThreadTestRunnable[] runnables = new MultiThreadTestRunnable[noThreads]; |
35 | for(int i = 0; i<noThreads; i++) { | 36 | for(int i = 0; i<noThreads; i++) { |
36 | runnables[i] = new MultiThreadTestRunnable(scenario+"-T"+(i+1), store, steps, maxKey, values, seed, commitFrequency); | 37 | runnables[i] = new MultiThreadTestRunnable(scenario+"-T"+(i+1), store, steps, maxKey, values, seed, commitFrequency); |
37 | } | 38 | } |
38 | 39 | ||
39 | // initialize threads | 40 | // initialize threads |
40 | Thread[] threads = new Thread[noThreads]; | 41 | Thread[] threads = new Thread[noThreads]; |
41 | for(int i = 0; i<noThreads; i++) { | 42 | for(int i = 0; i<noThreads; i++) { |
42 | threads[i] = new Thread(runnables[i]); | 43 | threads[i] = new Thread(runnables[i]); |
43 | } | 44 | } |
44 | 45 | ||
45 | // start threads; | 46 | // start threads; |
46 | for(int i = 0; i<noThreads; i++) { | 47 | for(int i = 0; i<noThreads; i++) { |
47 | threads[i].start(); | 48 | threads[i].start(); |
48 | } | 49 | } |
49 | 50 | ||
50 | // wait all the threads; | 51 | // wait all the threads; |
51 | for(int i = 0; i<noThreads; i++) { | 52 | for(int i = 0; i<noThreads; i++) { |
52 | try { | 53 | try { |
@@ -55,40 +56,42 @@ class MultiThreadFuzzTest { | |||
55 | fail("Thread "+i+" interrupted."); | 56 | fail("Thread "+i+" interrupted."); |
56 | } | 57 | } |
57 | } | 58 | } |
58 | 59 | ||
59 | // collect errors | 60 | // collect errors |
60 | List<Throwable> errors = new LinkedList<>(); | 61 | List<Throwable> errors = new LinkedList<>(); |
61 | for(int i = 0; i<noThreads; i++) { | 62 | for(int i = 0; i<noThreads; i++) { |
62 | errors.addAll(runnables[i].getErrors()); | 63 | errors.addAll(runnables[i].getErrors()); |
63 | } | 64 | } |
64 | 65 | ||
65 | assertEquals(Collections.EMPTY_LIST, errors); | 66 | assertEquals(Collections.EMPTY_LIST, errors); |
66 | } | 67 | } |
67 | 68 | ||
68 | @ParameterizedTest(name = "Multithread {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 69 | @ParameterizedTest(name = "Multithread {index}/{0} Steps={1} Keys={2} Values={3} defaultNull={4} commit " + |
70 | "frequency={5} seed={6} evil-hash={7}") | ||
69 | @MethodSource | 71 | @MethodSource |
70 | @Timeout(value = 10) | 72 | @Timeout(value = 10) |
71 | @Tag("fuzz") | 73 | @Tag("fuzz") |
72 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 74 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean defaultNull, int commitFrequency, |
73 | boolean evilHash) { | 75 | int seed, boolean evilHash) { |
74 | runFuzzTest("MultithreadS" + steps + "K" + noKeys + "V" + noValues + "CF" + commitFrequency + "s" + seed, seed, steps, noKeys, noValues, | 76 | runFuzzTest("MultithreadS" + steps + "K" + noKeys + "V" + noValues + defaultNull + "CF" + commitFrequency + |
75 | commitFrequency, evilHash); | 77 | "s" + seed, seed, steps, noKeys, noValues, defaultNull, commitFrequency, evilHash); |
76 | } | 78 | } |
77 | 79 | ||
78 | static Stream<Arguments> parametrizedFastFuzz() { | 80 | static Stream<Arguments> parametrizedFastFuzz() { |
79 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 81 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
80 | new Object[] { 2, 3 }, new Object[] { 10, 100 }, new Object[] { 1, 2, 3 }, | 82 | new Object[] { 2, 3 }, new Object[]{false, true}, new Object[] { 10, 100 }, new Object[] { 1, 2, 3 }, |
81 | new Object[] { false, true }); | 83 | new Object[] { false, true }); |
82 | } | 84 | } |
83 | 85 | ||
84 | @ParameterizedTest(name = "Multithread {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 86 | @ParameterizedTest(name = "Multithread {index}/{0} Steps={1} Keys={2} Values={3} defaultNull={4} commit " + |
87 | "frequency={5} seed={6} evil-hash={7}") | ||
85 | @MethodSource | 88 | @MethodSource |
86 | @Tag("fuzz") | 89 | @Tag("fuzz") |
87 | @Tag("slow") | 90 | @Tag("slow") |
88 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 91 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, int seed, |
89 | boolean evilHash) { | 92 | boolean evilHash) { |
90 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 93 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
91 | commitFrequency, evilHash); | 94 | nullDefault, commitFrequency, evilHash); |
92 | } | 95 | } |
93 | 96 | ||
94 | static Stream<Arguments> parametrizedSlowFuzz() { | 97 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java index d40c49c4..008258bd 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableFuzzTest.java | |||
@@ -19,8 +19,9 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
20 | 20 | ||
21 | class MutableFuzzTest { | 21 | class MutableFuzzTest { |
22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, boolean evilHash) { | 22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
23 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 23 | boolean nullDefault, boolean evilHash) { |
24 | String[] values = MapTestEnvironment.prepareValues(maxValue,nullDefault); | ||
24 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 25 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
25 | 26 | ||
26 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 27 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
@@ -60,30 +61,34 @@ class MutableFuzzTest { | |||
60 | } | 61 | } |
61 | } | 62 | } |
62 | 63 | ||
63 | @ParameterizedTest(name = "Mutable {index}/{0} Steps={1} Keys={2} Values={3} seed={4} evil-hash={5}") | 64 | @ParameterizedTest(name = "Mutable {index}/{0} Steps={1} Keys={2} Values={3} defaultNull={4} seed={5} " + |
65 | "evil-hash={6}") | ||
64 | @MethodSource | 66 | @MethodSource |
65 | @Timeout(value = 10) | 67 | @Timeout(value = 10) |
66 | @Tag("fuzz") | 68 | @Tag("fuzz") |
67 | void parametrizedFuzz(int test, int steps, int noKeys, int noValues, int seed, boolean evilHash) { | 69 | void parametrizedFuzz(int test, int steps, int noKeys, int noValues, boolean defaultNull, int seed, |
70 | boolean evilHash) { | ||
68 | runFuzzTest( | 71 | runFuzzTest( |
69 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed + "H" + (evilHash ? "Evil" : "Normal"), | 72 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed + "H" + (evilHash ? "Evil" : "Normal"), |
70 | seed, steps, noKeys, noValues, evilHash); | 73 | seed, steps, noKeys, noValues, defaultNull, evilHash); |
71 | } | 74 | } |
72 | 75 | ||
73 | static Stream<Arguments> parametrizedFuzz() { | 76 | static Stream<Arguments> parametrizedFuzz() { |
74 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, | 77 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, |
75 | new Object[] { 3, 32, 32 * 32, 32 * 32 * 32 * 32 }, new Object[] { 2, 3 }, new Object[] { 1, 2, 3 }, | 78 | new Object[] { 3, 32, 32 * 32, 32 * 32 * 32 * 32 }, new Object[] { 2, 3 }, new Object[] { false, true }, |
76 | new Object[] { false, true }); | 79 | new Object[] { 1, 2, 3 }, new Object[] { false, true }); |
77 | } | 80 | } |
78 | 81 | ||
79 | @ParameterizedTest(name = "Mutable {index}/{0} Steps={1} Keys={2} Values={3} seed={4} evil-hash={5}") | 82 | @ParameterizedTest(name = "Mutable {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} seed={5} " + |
83 | "evil-hash={6}") | ||
80 | @MethodSource | 84 | @MethodSource |
81 | @Tag("fuzz") | 85 | @Tag("fuzz") |
82 | @Tag("slow") | 86 | @Tag("slow") |
83 | void parametrizedSlowFuzz(int test, int steps, int noKeys, int noValues, int seed, boolean evilHash) { | 87 | void parametrizedSlowFuzz(int test, int steps, int noKeys, int noValues, boolean nullDefault, int seed, |
88 | boolean evilHash) { | ||
84 | runFuzzTest( | 89 | runFuzzTest( |
85 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed + "H" + (evilHash ? "Evil" : "Normal"), | 90 | "MutableS" + steps + "K" + noKeys + "V" + noValues + "s" + seed + "H" + (evilHash ? "Evil" : "Normal"), |
86 | seed, steps, noKeys, noValues, evilHash); | 91 | seed, steps, noKeys, noValues, nullDefault, evilHash); |
87 | } | 92 | } |
88 | 93 | ||
89 | static Stream<Arguments> parametrizedSlowFuzz() { | 94 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableImmutableCompareFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableImmutableCompareFuzzTest.java index 410705a2..6e15b8ca 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableImmutableCompareFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/MutableImmutableCompareFuzzTest.java | |||
@@ -19,9 +19,9 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 19 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
20 | 20 | ||
21 | class MutableImmutableCompareFuzzTest { | 21 | class MutableImmutableCompareFuzzTest { |
22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 22 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
23 | boolean evilHash) { | 23 | boolean nullDefault, int commitFrequency, boolean evilHash) { |
24 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 24 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
25 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 25 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
26 | 26 | ||
27 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 27 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
@@ -57,30 +57,32 @@ class MutableImmutableCompareFuzzTest { | |||
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 60 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} " + |
61 | "commit frequency={5} seed={6} evil-hash={7}") | ||
61 | @MethodSource | 62 | @MethodSource |
62 | @Timeout(value = 10) | 63 | @Timeout(value = 10) |
63 | @Tag("fuzz") | 64 | @Tag("fuzz") |
64 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 65 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
65 | boolean evilHash) { | 66 | int seed, boolean evilHash) { |
66 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, | 67 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, |
67 | noKeys, noValues, commitFrequency, evilHash); | 68 | noKeys, noValues, nullDefault, commitFrequency, evilHash); |
68 | } | 69 | } |
69 | 70 | ||
70 | static Stream<Arguments> parametrizedFastFuzz() { | 71 | static Stream<Arguments> parametrizedFastFuzz() { |
71 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 72 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
72 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 73 | new Object[] { 2, 3 }, new Object[]{false,true}, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
73 | new Object[] { false, true }); | 74 | new Object[] { false, true }); |
74 | } | 75 | } |
75 | 76 | ||
76 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 77 | @ParameterizedTest(name = "Mutable-Immutable Compare {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} " + |
78 | "commit frequency={5} seed={6} evil-hash={7}") | ||
77 | @MethodSource | 79 | @MethodSource |
78 | @Tag("fuzz") | 80 | @Tag("fuzz") |
79 | @Tag("slow") | 81 | @Tag("slow") |
80 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 82 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
81 | boolean evilHash) { | 83 | int seed, boolean evilHash) { |
82 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, | 84 | runFuzzTest("MutableImmutableCompareS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, |
83 | noKeys, noValues, commitFrequency, evilHash); | 85 | noKeys, noValues, nullDefault, commitFrequency, evilHash); |
84 | } | 86 | } |
85 | 87 | ||
86 | static Stream<Arguments> parametrizedSlowFuzz() { | 88 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java index 2e29a03f..35a54712 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/RestoreFuzzTest.java | |||
@@ -21,9 +21,10 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
21 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 21 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
22 | 22 | ||
23 | class RestoreFuzzTest { | 23 | class RestoreFuzzTest { |
24 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 24 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
25 | boolean nullDefault, int commitFrequency, | ||
25 | boolean evilHash) { | 26 | boolean evilHash) { |
26 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 27 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
27 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 28 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
28 | 29 | ||
29 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); | 30 | VersionedMapStore<Integer, String> store = new VersionedMapStoreImpl<Integer, String>(chp, values[0]); |
@@ -77,30 +78,32 @@ class RestoreFuzzTest { | |||
77 | 78 | ||
78 | } | 79 | } |
79 | 80 | ||
80 | @ParameterizedTest(name = "Restore {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 81 | @ParameterizedTest(name = "Restore {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit frequency={5}" + |
82 | " seed={6} evil-hash={7}") | ||
81 | @MethodSource | 83 | @MethodSource |
82 | @Timeout(value = 10) | 84 | @Timeout(value = 10) |
83 | @Tag("smoke") | 85 | @Tag("smoke") |
84 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 86 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
85 | boolean evilHash) { | 87 | int seed, boolean evilHash) { |
86 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 88 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
87 | commitFrequency, evilHash); | 89 | nullDefault, commitFrequency, evilHash); |
88 | } | 90 | } |
89 | 91 | ||
90 | static Stream<Arguments> parametrizedFastFuzz() { | 92 | static Stream<Arguments> parametrizedFastFuzz() { |
91 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 93 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
92 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 94 | new Object[] { 2, 3 }, new Object[]{false, true}, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
93 | new Object[] { false, true }); | 95 | new Object[] { false, true }); |
94 | } | 96 | } |
95 | 97 | ||
96 | @ParameterizedTest(name = "Restore {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 98 | @ParameterizedTest(name = "Restore {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit frequency={5}" + |
99 | " seed={6} evil-hash={7}") | ||
97 | @MethodSource | 100 | @MethodSource |
98 | @Tag("smoke") | 101 | @Tag("smoke") |
99 | @Tag("slow") | 102 | @Tag("slow") |
100 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 103 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
101 | boolean evilHash) { | 104 | int seed, boolean evilHash) { |
102 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 105 | runFuzzTest("RestoreS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
103 | commitFrequency, evilHash); | 106 | nullDefault, commitFrequency, evilHash); |
104 | } | 107 | } |
105 | 108 | ||
106 | static Stream<Arguments> parametrizedSlowFuzz() { | 109 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SharedStoreFuzzTest.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SharedStoreFuzzTest.java index 914a0f63..ac033edb 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SharedStoreFuzzTest.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/fuzz/SharedStoreFuzzTest.java | |||
@@ -21,9 +21,9 @@ import tools.refinery.store.map.tests.fuzz.utils.FuzzTestUtils; | |||
21 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; | 21 | import tools.refinery.store.map.tests.utils.MapTestEnvironment; |
22 | 22 | ||
23 | class SharedStoreFuzzTest { | 23 | class SharedStoreFuzzTest { |
24 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, int commitFrequency, | 24 | private void runFuzzTest(String scenario, int seed, int steps, int maxKey, int maxValue, |
25 | boolean evilHash) { | 25 | boolean nullDefault, int commitFrequency, boolean evilHash) { |
26 | String[] values = MapTestEnvironment.prepareValues(maxValue); | 26 | String[] values = MapTestEnvironment.prepareValues(maxValue, nullDefault); |
27 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); | 27 | ContinousHashProvider<Integer> chp = MapTestEnvironment.prepareHashProvider(evilHash); |
28 | 28 | ||
29 | List<VersionedMapStore<Integer, String>> stores = VersionedMapStoreImpl.createSharedVersionedMapStores(5, chp, values[0]); | 29 | List<VersionedMapStore<Integer, String>> stores = VersionedMapStoreImpl.createSharedVersionedMapStores(5, chp, values[0]); |
@@ -39,7 +39,7 @@ class SharedStoreFuzzTest { | |||
39 | for(VersionedMapStore<Integer, String> store : stores) { | 39 | for(VersionedMapStore<Integer, String> store : stores) { |
40 | versioneds.add((VersionedMapImpl<Integer, String>) store.createMap()); | 40 | versioneds.add((VersionedMapImpl<Integer, String>) store.createMap()); |
41 | } | 41 | } |
42 | 42 | ||
43 | List<Map<Integer, Long>> index2Version = new LinkedList<>(); | 43 | List<Map<Integer, Long>> index2Version = new LinkedList<>(); |
44 | for(int i = 0; i<stores.size(); i++) { | 44 | for(int i = 0; i<stores.size(); i++) { |
45 | index2Version.add(new HashMap<>()); | 45 | index2Version.add(new HashMap<>()); |
@@ -56,7 +56,7 @@ class SharedStoreFuzzTest { | |||
56 | index2Version.get(storeIndex).put(i, version); | 56 | index2Version.get(storeIndex).put(i, version); |
57 | } | 57 | } |
58 | MapTestEnvironment.printStatus(scenario, stepIndex, steps, "building"); | 58 | MapTestEnvironment.printStatus(scenario, stepIndex, steps, "building"); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | // 2. create a non-versioned and | 61 | // 2. create a non-versioned and |
62 | List<VersionedMapImpl<Integer, String>> reference = new LinkedList<>(); | 62 | List<VersionedMapImpl<Integer, String>> reference = new LinkedList<>(); |
@@ -76,35 +76,37 @@ class SharedStoreFuzzTest { | |||
76 | MapTestEnvironment.compareTwoMaps(scenario + ":" + index, reference.get(storeIndex), versioneds.get(storeIndex)); | 76 | MapTestEnvironment.compareTwoMaps(scenario + ":" + index, reference.get(storeIndex), versioneds.get(storeIndex)); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | MapTestEnvironment.printStatus(scenario, index, steps, "comparison"); | 79 | MapTestEnvironment.printStatus(scenario, index, steps, "comparison"); |
80 | } | 80 | } |
81 | 81 | ||
82 | } | 82 | } |
83 | 83 | ||
84 | @ParameterizedTest(name = "Shared Store {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 84 | @ParameterizedTest(name = "Shared Store {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit " + |
85 | "frequency={4} seed={5} evil-hash={6}") | ||
85 | @MethodSource | 86 | @MethodSource |
86 | @Timeout(value = 10) | 87 | @Timeout(value = 10) |
87 | @Tag("smoke") | 88 | @Tag("smoke") |
88 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 89 | void parametrizedFastFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
89 | boolean evilHash) { | 90 | int seed, boolean evilHash) { |
90 | runFuzzTest("SharedS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 91 | runFuzzTest("SharedS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
91 | commitFrequency, evilHash); | 92 | nullDefault, commitFrequency, evilHash); |
92 | } | 93 | } |
93 | 94 | ||
94 | static Stream<Arguments> parametrizedFastFuzz() { | 95 | static Stream<Arguments> parametrizedFastFuzz() { |
95 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, | 96 | return FuzzTestUtils.permutationWithSize(new Object[] { FuzzTestUtils.FAST_STEP_COUNT }, new Object[] { 3, 32, 32 * 32 }, |
96 | new Object[] { 2, 3 }, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, | 97 | new Object[] { 2, 3 }, new Object[]{false, true}, new Object[] { 1, 10, 100 }, new Object[] { 1, 2, 3 }, |
97 | new Object[] { false, true }); | 98 | new Object[] { false, true }); |
98 | } | 99 | } |
99 | 100 | ||
100 | @ParameterizedTest(name = "Shared Store {index}/{0} Steps={1} Keys={2} Values={3} commit frequency={4} seed={5} evil-hash={6}") | 101 | @ParameterizedTest(name = "Shared Store {index}/{0} Steps={1} Keys={2} Values={3} nullDefault={4} commit " + |
102 | "frequency={4} seed={5} evil-hash={6}") | ||
101 | @MethodSource | 103 | @MethodSource |
102 | @Tag("smoke") | 104 | @Tag("smoke") |
103 | @Tag("slow") | 105 | @Tag("slow") |
104 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, int commitFrequency, int seed, | 106 | void parametrizedSlowFuzz(int tests, int steps, int noKeys, int noValues, boolean nullDefault, int commitFrequency, |
105 | boolean evilHash) { | 107 | int seed, boolean evilHash) { |
106 | runFuzzTest("SharedS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, | 108 | runFuzzTest("SharedS" + steps + "K" + noKeys + "V" + noValues + "s" + seed, seed, steps, noKeys, noValues, |
107 | commitFrequency, evilHash); | 109 | nullDefault, commitFrequency, evilHash); |
108 | } | 110 | } |
109 | 111 | ||
110 | static Stream<Arguments> parametrizedSlowFuzz() { | 112 | static Stream<Arguments> parametrizedSlowFuzz() { |
diff --git a/subprojects/store/src/test/java/tools/refinery/store/map/tests/utils/MapTestEnvironment.java b/subprojects/store/src/test/java/tools/refinery/store/map/tests/utils/MapTestEnvironment.java index 2d03ebaf..10ea2796 100644 --- a/subprojects/store/src/test/java/tools/refinery/store/map/tests/utils/MapTestEnvironment.java +++ b/subprojects/store/src/test/java/tools/refinery/store/map/tests/utils/MapTestEnvironment.java | |||
@@ -9,9 +9,14 @@ import java.util.Map.Entry; | |||
9 | import static org.junit.jupiter.api.Assertions.*; | 9 | import static org.junit.jupiter.api.Assertions.*; |
10 | 10 | ||
11 | public class MapTestEnvironment<K, V> { | 11 | public class MapTestEnvironment<K, V> { |
12 | public static String[] prepareValues(int maxValue) { | 12 | public static String[] prepareValues(int maxValue, boolean nullDefault) { |
13 | String[] values = new String[maxValue]; | 13 | String[] values = new String[maxValue]; |
14 | values[0] = "DEFAULT"; | 14 | if(nullDefault) { |
15 | values[0] = null; | ||
16 | } else { | ||
17 | values[0] = "DEFAULT"; | ||
18 | } | ||
19 | |||
15 | for (int i = 1; i < values.length; i++) { | 20 | for (int i = 1; i < values.length; i++) { |
16 | values[i] = "VAL" + i; | 21 | values[i] = "VAL" + i; |
17 | } | 22 | } |