package ch.ntb.inf.deep.testClasses;

public class T02Branches {
    public static int if1(int a) {
        int i;
        if(a > 0) {
            i = a + 1;
        }
        else {
            i = a - 1;
        }
        return i;
    }

    public static void if2() {	// constants
        int a = 1;
        int b = 2;
        if(a >= b){
            a = 6;
        }
        else{
            a = 8;
        }
        b=a;
        a++;
    }

    public static void if3() {	// nested if
        int x = 0, y = 1;
        if(x == 0) {
            if(y == 1) {
                x++;
                if(x == 1) {
                    y++;
                    if(y == 2) {
                        int a, b, c;                        
                        a = 1;
                        b = 2;
                        c = a - b;
                        c++;
                    }

                }
            }
        }
    }

	public void if4() {	// if boolean
		boolean bool = true;
		int a = 1;
		int b = 0;

		if(bool) {
			b = 8;
		}
		else {
			b = 2;
		}
		a = b;
		a++;
	}
}

@@ -1139,11 +1139,145 @@
 +;%0D%0A%09%7D%0D%0A
+%09%0D%0A%09public int if5(int n, int m)%7B//example from mssenbck for loadParameter%0D%0A%09%09if(n %3C 0)%7B%0D%0A%09%09%09n = 0; m = 0;%0D%0A%09%09%7D%0D%0A%09%09return n + m;%0D%0A%09%7D%0D%0A
 %7D%0D%0A

add testmethod if5(int n, int m)