diff options
| author | Cliff Click <cliffc@acm.org> | 2025-05-06 13:44:10 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2025-07-08 20:29:09 -0700 |
| commit | 664761624f4b0e3d6d1593b99e576854beec5949 (patch) | |
| tree | edff0e36e07cdc5aa82c8f7d144d68c52d5a4365 /src/test/java/com/seaofnodes/simple/fuzzer | |
| parent | 018379b0cf4e286ceacb1e39f34dd80f770e381e (diff) | |
| download | Simple-linear-chapter23.tar.gz Simple-linear-chapter23.zip | |
Chapter 23: Methods and Revisiting Typeslinear-chapter23
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/fuzzer')
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/fuzzer/Fuzzer.java | 8 | ||||
| -rw-r--r-- | src/test/java/com/seaofnodes/simple/fuzzer/FuzzerUtils.java | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/test/java/com/seaofnodes/simple/fuzzer/Fuzzer.java b/src/test/java/com/seaofnodes/simple/fuzzer/Fuzzer.java index 30a548ad..77e61b42 100644 --- a/src/test/java/com/seaofnodes/simple/fuzzer/Fuzzer.java +++ b/src/test/java/com/seaofnodes/simple/fuzzer/Fuzzer.java @@ -22,7 +22,7 @@ import java.util.function.Consumer; */ public class Fuzzer { - private static final int EVAL_TIMEOUT = 1000; + private static final int EVAL_TIMEOUT = 10000; /** * List of exceptions already encountered. @@ -82,10 +82,10 @@ public class Fuzzer { private static void runCheck(String script, boolean valid) { CodeGen code1; try { - code1 = FuzzerUtils.parse(script, 123); + code1 = FuzzerUtils.parse(script, 123, true); } catch (RuntimeException e1) { try { - FuzzerUtils.parse(script, 456); + FuzzerUtils.parse(script, 456, false); } catch (RuntimeException e2) { if (FuzzerUtils.isExceptionFromSameCause(e1, e2)) { if (!valid || e1.getClass() == Parser.ParseException.class) return; @@ -95,7 +95,7 @@ public class Fuzzer { } throw e1; } - CodeGen code2 = FuzzerUtils.parse(script, 456); + CodeGen code2 = FuzzerUtils.parse(script, 456, false); checkGraphs(code1, code2, 0); checkGraphs(code1, code2, 1); checkGraphs(code1, code2, 10); diff --git a/src/test/java/com/seaofnodes/simple/fuzzer/FuzzerUtils.java b/src/test/java/com/seaofnodes/simple/fuzzer/FuzzerUtils.java index b90b663d..e08b73fc 100644 --- a/src/test/java/com/seaofnodes/simple/fuzzer/FuzzerUtils.java +++ b/src/test/java/com/seaofnodes/simple/fuzzer/FuzzerUtils.java @@ -94,13 +94,13 @@ class FuzzerUtils { /** * Parse script with peepholes enabled or disabled */ - public static CodeGen parse(String script, long workListSeed) { + public static CodeGen parse(String script, long workListSeed, boolean reset) { var err = System.err; var out = System.out; try { System.setErr(NULL_PRINT_STREAM); System.setOut(NULL_PRINT_STREAM); - var code = new CodeGen(script, TypeInteger.BOT, workListSeed); + var code = new CodeGen(script, TypeInteger.BOT, workListSeed, reset); return code.driver(CodeGen.Phase.LocalSched); } finally { System.setErr(err); |
