Skip to content

Commit

Permalink
Ooops, forgot to commit Testcase.java
Browse files Browse the repository at this point in the history
  • Loading branch information
floyd committed Aug 24, 2016
1 parent 5493a40 commit d66a56b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Testcase.java
@@ -0,0 +1,29 @@
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class Testcase{
public native void nativeCrash();
public static void main(String args[]){
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
try{
String s = in.readLine();
if(s == null || s.length() == 0){
System.out.println("Hum?");
System.exit(1);
}
if(s.charAt(0) == '0'){
System.out.println("Looks like a zero to me!");
//System.exit(134); //Doesn't work, although it looks "the same" in a bash $?, it's not the same, therefore:
new Testcase().nativeCrash();
}
else{
System.out.println("A non-zero value? How quaint!");
}
System.exit(0);
}
catch(IOException ioe){
System.out.println("Hum?");
System.exit(1);
}
}
}

0 comments on commit d66a56b

Please sign in to comment.