Loading ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_001.ttcn 0 → 100644 +33 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_001 { type component GeneralComp { } template integer m_msg := 1; function f_test(in integer p_val) { if (p_val == 1) { setverdict(pass); } else { setverdict(fail); } } testcase TC_NegSem_050402_actual_parameters_001() runs on GeneralComp { f_test(m_msg); // tested parameter passing } control { execute(TC_NegSem_050402_actual_parameters_001()); } } ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_002.ttcn 0 → 100644 +32 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template variables cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_002 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 2) { setverdict(pass); } else { setverdict(fail); } } testcase TC_NegSem_050402_actual_parameters_002() runs on GeneralComp { var template integer vm_msg := 2; f_test(vm_msg); // tested parameter passing } control { execute(TC_NegSem_050402_actual_parameters_002()); } } ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_003.ttcn 0 → 100644 +36 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template in parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_003 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 3) { setverdict(pass); } else { setverdict(fail); } } function f_caller(in template integer p_val) { f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_003() runs on GeneralComp { f_caller(3); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_003()); } } ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_004.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template out parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_004 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 4) { setverdict(pass); } else { setverdict(fail); } } function f_caller(out template integer p_val) { p_val := 4; // out parameter shall have a value before we can pass it to a function f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_004() runs on GeneralComp { var template integer v_val; f_caller(v_val); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_004()); } } ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_005.ttcn 0 → 100644 +37 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template inout parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_005 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 4) { setverdict(pass); } else { setverdict(fail); } } function f_caller(inout template integer p_val) { f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_005() runs on GeneralComp { var template integer v_val := 5; f_caller(v_val); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_005()); } } Loading
ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_001.ttcn 0 → 100644 +33 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_001 { type component GeneralComp { } template integer m_msg := 1; function f_test(in integer p_val) { if (p_val == 1) { setverdict(pass); } else { setverdict(fail); } } testcase TC_NegSem_050402_actual_parameters_001() runs on GeneralComp { f_test(m_msg); // tested parameter passing } control { execute(TC_NegSem_050402_actual_parameters_001()); } }
ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_002.ttcn 0 → 100644 +32 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template variables cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_002 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 2) { setverdict(pass); } else { setverdict(fail); } } testcase TC_NegSem_050402_actual_parameters_002() runs on GeneralComp { var template integer vm_msg := 2; f_test(vm_msg); // tested parameter passing } control { execute(TC_NegSem_050402_actual_parameters_002()); } }
ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_003.ttcn 0 → 100644 +36 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template in parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_003 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 3) { setverdict(pass); } else { setverdict(fail); } } function f_caller(in template integer p_val) { f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_003() runs on GeneralComp { f_caller(3); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_003()); } }
ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_004.ttcn 0 → 100644 +38 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template out parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_004 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 4) { setverdict(pass); } else { setverdict(fail); } } function f_caller(out template integer p_val) { p_val := 4; // out parameter shall have a value before we can pass it to a function f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_004() runs on GeneralComp { var template integer v_val; f_caller(v_val); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_004()); } }
ATS/05_basic_language_elements/0504_parametrization/050402_actual_parameters/NegSem_050402_actual_parameters_005.ttcn 0 → 100644 +37 −0 Original line number Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.2, verify that template inout parameters cannot be used as in formal value parameters of functions ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Actual parameters that are passed by value to in formal value parameters shall be // variables, literal values, module parameters, constants, variables, value returning // (external) functions, formal value parameters (of in, inout or out parameterization) // of the current scope or expressions composed of the above. module NegSem_050402_actual_parameters_005 { type component GeneralComp { } function f_test(in integer p_val) { if (p_val == 4) { setverdict(pass); } else { setverdict(fail); } } function f_caller(inout template integer p_val) { f_test(p_val); // tested parameter passing } testcase TC_NegSem_050402_actual_parameters_005() runs on GeneralComp { var template integer v_val := 5; f_caller(v_val); // this parameter passing is not a subject of the test } control { execute(TC_NegSem_050402_actual_parameters_005()); } }