Skip to content

Commit

Permalink
testsuite: add more Java tests for seed2
Browse files Browse the repository at this point in the history
  • Loading branch information
kiritofeng authored and Xyene committed Jan 29, 2023
1 parent 8bda48f commit ee64225
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testsuite/seed2/tests/java_ir/seed2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public class Seed2 {
public static void main(String[] args) {
int[] arr = new int[1];
arr[1] = 1;
}
}
6 changes: 6 additions & 0 deletions testsuite/seed2/tests/java_ir/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: JAVA8
time: 2
memory: 65536
source: seed2.java
expect: IR
feedback: java.lang.ArrayIndexOutOfBoundsException
23 changes: 23 additions & 0 deletions testsuite/seed2/tests/java_mle/seed2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.util.*;

public class Seed2 {
public static void main(String[] args) {
int[] arr = new int[1000000000];
Scanner sc = new Scanner(System.in);
String result;
long lo = 1;
long hi = 2000000000;
long num;
while (lo < hi) {
num = (lo + hi) / 2;
System.out.println(num);
result = sc.nextLine();
if (result.equals("FLOATS"))
hi = num;
else if (result.equals("SINKS"))
lo = num + 1;
else
break;
}
}
}
5 changes: 5 additions & 0 deletions testsuite/seed2/tests/java_mle/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: JAVA8
time: 2
memory: 65536
source: seed2.java
expect: MLE

0 comments on commit ee64225

Please sign in to comment.