Commit 2dc2b1ab authored by urbant's avatar urbant
Browse files

Tests for actual parameters (restrictions and examples)

Progress file update
parent b974c451
Loading
Loading
Loading
Loading
+29 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify that list notation containing actual parameters in wrong order is not accepted
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// When using list notation, the order of elements in the actual parameter list shall 
// be the same as their order in the corresponding formal parameter list.

module NegSem_050402_actual_parameters_100 { 

    type component GeneralComp {
	}

    function f_test (integer p_val1, charstring p_val2) {
        if (p_val1 == 1 and p_val2 == "test") { setverdict(pass); }
        else { setverdict(fail); }
    }

    testcase TC_NegSem_050402_actual_parameters_100() runs on GeneralComp {
        f_test("test", 1);
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_100());
	}
}
+28 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify that list notation containing less actual parameters than required is not accepted
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// For each formal parameter without a default there shall be an actual parameter.

module NegSem_050402_actual_parameters_101 { 

    type component GeneralComp {
	}

    function f_test (integer p_val1, charstring p_val2) {
        if (p_val1 == 1) { setverdict(pass); }
        else { setverdict(fail); }
    }

    testcase TC_NegSem_050402_actual_parameters_101() runs on GeneralComp {
        f_test(1);
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_101());
	}
}
+28 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify that parameter without default value cannot be skipped
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// For each formal parameter without a default there shall be an actual parameter.

module NegSem_050402_actual_parameters_102 { 

    type component GeneralComp {
	}

    function f_test (integer p_val1, charstring p_val2) {
        if (p_val1 == 1) { setverdict(pass); }
        else { setverdict(fail); }
    }

    testcase TC_NegSem_050402_actual_parameters_102() runs on GeneralComp {
        f_test(1, -);
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_102());
	}
}
+29 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify that mixing list and assignment notation is not allowed in parameterized calls (value as actual parameter)
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Either list notation or assignment notation shall be used in a single parameter 
// list. They shall not be mixed.

module NegSem_050402_actual_parameters_103 { 

    type component GeneralComp {
	}

    function f_test (integer p_val1, charstring p_val2) {
        if (p_val1 == 1 and p_val2 == "test") { setverdict(pass); }
        else { setverdict(fail); }
    }

    testcase TC_NegSem_050402_actual_parameters_103() runs on GeneralComp {
        f_test(p_val1 := 1, "test");
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_103());
	}
}
+29 −0
Original line number Diff line number Diff line
/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify that mixing list and assignment notation is not allowed in parameterized calls (skipped actual parameter)
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Either list notation or assignment notation shall be used in a single parameter 
// list. They shall not be mixed.

module NegSem_050402_actual_parameters_104 { 

    type component GeneralComp {
	}

    function f_test (integer p_val1, charstring p_val2 := "test") {
        if (p_val1 == 1 and p_val2 == "test") { setverdict(pass); }
        else { setverdict(fail); }
    }

    testcase TC_NegSem_050402_actual_parameters_104() runs on GeneralComp {
        f_test(p_val1 := 1, -);
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_104());
	}
}
Loading