diff --git a/fuzzer/Fuzzer.java b/fuzzer/Fuzzer.java index caf44ca0ae7720647a50191bf0cb22a2a0b02f35..9e42f76a8b95962ebf4a294d5c17e3f4e63995d4 100644 --- a/fuzzer/Fuzzer.java +++ b/fuzzer/Fuzzer.java @@ -37,6 +37,8 @@ public class Fuzzer { private static final int VAR_MAX = 2147483647; // Maximum number of items in stack private static final int MAX_STACK_SIZE = 512; + // Maxiumum time difference for different executions to be counted as apart of the same batch of tests + private static final long MAX_TIME_DIFF = 5000; // Should be 5 seconds // Random number generator private static Random rand = new Random(System.currentTimeMillis()); @@ -82,9 +84,14 @@ public class Fuzzer { private static int getRun(){ int runCount = 0; + long curTime = System.currentTimeMillis(); try { Scanner input = new Scanner(new File("runCount.txt")); runCount = input.nextInt() + 1; + long runTime = input.nextLong(); + if (curTime - runTime > MAX_TIME_DIFF) { + runCount = 0; + } } catch (Exception e){ // Carry on } @@ -100,6 +107,8 @@ public class Fuzzer { pw = new PrintWriter(out); pw.print(runCount); + pw.print(" "); + pw.print(System.currentTimeMillis()); }catch (Exception e){ e.printStackTrace(System.err); diff --git a/runCount.txt b/runCount.txt deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000