Commit f4953a46 authored by Johannes Bucher's avatar Johannes Bucher

group6 exec test cases.

Also includes a few semantic tests which were not already merged into the shared repo.
parent 48c9e4a7
class FieldInit {
public int i;
public FieldInit f;
public boolean b;
public static void main(String[] args) {
FieldInit f = new FieldInit();
System.out.println(f.i);
if(!f.b) {
System.out.println(1);
}
if(f.f == null) {
System.out.println(2);
}
}
}
class Bools {
public boolean b;
public static void main(String[] args) {
Bools b = new Bools();
if(!b.b) {
System.out.println(1);
}
b.b = false || true;
if(!b.b) {
System.out.println(2);
}
b.b = false || false;
if(!b.b) {
System.out.println(3);
}
b.b = true || true;
if(!b.b) {
System.out.println(4);
}
b.b = true || false;
if(!b.b) {
System.out.println(5);
}
b.b = false && true;
if(!b.b) {
System.out.println(6);
}
b.b = true && true;
if(!b.b) {
System.out.println(7);
}
b.b = false && false;
if(!b.b) {
System.out.println(8);
}
b.b = true && false;
if(!b.b) {
System.out.println(9);
}
}
}
class EvaluationOrder {
public int i;
public EvaluationOrder setI(int i) {
this.i = i + 1;
System.out.println(this.i);
return this;}
public static void main(String[] args) {
EvaluationOrder e = new EvaluationOrder();
int[] arr = new int[3];
arr[e.setI(-1).i] = e.setI(e.setI(2).i).i + 4;
System.out.println(arr[0]);
}
}
\ No newline at end of file
class EvaluationOrder {
public int i;
public EvaluationOrder setI(int i) {
this.i = i + 1;
System.out.println(this.i);
return this;}
public static void main(String[] args) {
EvaluationOrder e = new EvaluationOrder();
int[] arr = new int[3];
arr[e.setI(-1).i] = e.setI(e.setI(2).i).i + e.setI(1).i * e.setI(2).i + e.setI(3).i / e.setI(4).i % e.setI(5).i;
System.out.println(arr[0]);
}
}
\ No newline at end of file
class If {
public static void main(String[] args) {
boolean b = true;
if (b) {
b = false;
if (b) {
System.out.println(1);
} else {
if (!b) {
if (b) {
System.out.println(2);
} else {
System.out.println(3);
}
} else {
b = true;
if (b) {
System.out.println(4);
} else {
System.out.println(5);
}
}
}
} else {
System.out.println(6);
}
}
}
\ No newline at end of file
class SimplePrint {
public static void main(String[] args) {
System.out.println(42);
}
}
\ No newline at end of file
class SimpleWriteFlush {
public static void main(String[] args) {
System.out.write(42);
System.out.flush();
}
}
\ No newline at end of file
class A{}
class Foo {
public static void main(String[] args) {
System.out.flush(new A());
}
}
class TypeA{}
class TypeB{}
class Foo {
public static void main(String[] args) {
TypeA a = new TypeA();
TypeB b = new TypeB();
if (a == b) {
}
}
}
class A{}
class Foo {
public static void main(String[] args) {
System.out.println(new A());
}
}
class Foo {
public static void main(String[] args) {
boolean a = System.in.read();
}
}
class Foo {
public static void main(String[] args) {
int a = System.in.read() + 5;
}
}
class A{}
class Foo {
public static void main(String[] args) {
System.out.write(new A());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment