Commit 33065104 authored by Carlos Galindo's avatar Carlos Galindo
Browse files

Add test case for a constructor with return statements at the end of every CFG path.

parent 6c4cfa82
Loading
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
class Test {

    int a;

    Test(int a, boolean b, int c) {
        if (b) {
            this.a = a * c / (a + c);
            return;
        } else {
            this.a = 10;
            return;
        }
    }

    public static void main(String[] args) {
        Test t = new Test(15, true, 10);
        int a = t.a;
        System.out.println(a);
    }
}
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
18
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
class Test {

    int a;

    Test(int a, boolean b, int c) {
        if (b) {
            this.a = a * c / (a + c);
            return;
        } else {
            this.a = 10;
            return;
        }
    }

    public static void main(String[] args) {
        Test t = new Test(15, true, 10);
        int a = t.a;
        System.out.println(a);
    }
}
 No newline at end of file