Loading ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 409, updated by STF 572 ** @version 0.0.2 ** @desc Test cases for clause 5.2 Scope rules ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_0503_Ordering_003 { type component GeneralComp { var integer vc_component := 0; } function f_function() runs on GeneralComp { var integer v_function := 0; } testcase TC_Sem_0503_Ordering_003() runs on GeneralComp { if(true) { var integer v_int := 0; if (v_int == 0) { var integer v_statement_block_1 := 0; v_statement_block_1 := v_statement_block_1 + 1; var integer v_statement_block_2 := 0; // declaration in the middle of the block are allowed } } setverdict(pass); } control { var integer v_control := 0; execute(TC_Sem_0503_Ordering_003()); } } ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 409, updated by STF 572 ** @version 0.0.1 ** @desc Test cases for clause 5.2 Scope rules ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_0503_Ordering_004 { type component GeneralComp { var integer vc_component := 0; } function f_function() runs on GeneralComp { var integer v_function; v_function := 0; var integer v_function_2 := 0; // declaration don't have to be in the beginning of a block any more } testcase TC_Sem_0503_Ordering_004() runs on GeneralComp { if(true) { var integer v_statement := 0; if (v_statement == 0) { var integer v_nested_statement := 0; } } setverdict(pass); } control { var integer v_control := 0; execute(TC_Sem_0503_Ordering_004()); } } ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot reference component variables ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction e) // The expression shall not refer to elements of the component type of the optional runs on clause. module NegSem_05040101_parameters_of_kind_value_008 language "TTCN-3:2016" { type component GeneralComp { var integer vc_int := 0; } function f(in integer p_int := vc_int) runs on GeneralComp { } testcase TC_NegSem_05040101_parameters_of_kind_value_008() runs on GeneralComp { f(); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_value_008()); } } ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn 0 → 100644 +33 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot invoke functions with runs on clause ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction e) // The expression shall not contain the invocation of functions with a runs on clause. module NegSem_05040101_parameters_of_kind_value_010 { type component GeneralComp { var integer vc_int; } function fx() runs on GeneralComp return integer { return vc_int + 1; } function f(in integer p_int := fx()) runs on GeneralComp { log(p_int); } testcase TC_NegSem_05040101_parameters_of_kind_value_010() runs on GeneralComp { f(); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_value_010()); } } ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn 0 → 100644 +38 −0 Original line number Original line Diff line number Diff line /***************************************************************** ** @author STF 521 ** @version 0.0.1 ** @purpose 1:5.4.1.1, Verify that altsteps with port parameters cannot be used in component.start operation ** @verdict pass reject *****************************************************************/ // The following requirement is tested: // Only function and altstep definitions may have formal port parameters, - with the exception of functions or // altsteps started as test component behaviour (see clause 21.3.2). module NegSem_05040101_parameters_of_kind_value_019 { type port P message { inout integer } type component C { port P p; } altstep a_test(P p_port) runs on C { [] p_port.receive(integer:?) { setverdict(pass); } } testcase TC_NegSem_05040101_parameters_of_kind_value_019() runs on C system C { var C v_ptc := C.create; connect(mtc:p, mtc:p); p.send(1); v_ptc.start(a_test(p)); v_ptc.done; } control { execute(TC_NegSem_05040101_parameters_of_kind_value_019()); } } No newline at end of file Loading
ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_003.ttcn 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 409, updated by STF 572 ** @version 0.0.2 ** @desc Test cases for clause 5.2 Scope rules ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_0503_Ordering_003 { type component GeneralComp { var integer vc_component := 0; } function f_function() runs on GeneralComp { var integer v_function := 0; } testcase TC_Sem_0503_Ordering_003() runs on GeneralComp { if(true) { var integer v_int := 0; if (v_int == 0) { var integer v_statement_block_1 := 0; v_statement_block_1 := v_statement_block_1 + 1; var integer v_statement_block_2 := 0; // declaration in the middle of the block are allowed } } setverdict(pass); } control { var integer v_control := 0; execute(TC_Sem_0503_Ordering_003()); } }
ATS/core_language/05_basic_language_elements/0503_ordering_of_declarations/Sem_0503_Ordering_004.ttcn 0 → 100644 +36 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 409, updated by STF 572 ** @version 0.0.1 ** @desc Test cases for clause 5.2 Scope rules ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering ** @verdict pass accept, ttcn3verdict:pass ***************************************************/ module Sem_0503_Ordering_004 { type component GeneralComp { var integer vc_component := 0; } function f_function() runs on GeneralComp { var integer v_function; v_function := 0; var integer v_function_2 := 0; // declaration don't have to be in the beginning of a block any more } testcase TC_Sem_0503_Ordering_004() runs on GeneralComp { if(true) { var integer v_statement := 0; if (v_statement == 0) { var integer v_nested_statement := 0; } } setverdict(pass); } control { var integer v_control := 0; execute(TC_Sem_0503_Ordering_004()); } }
ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_008.ttcn 0 → 100644 +28 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot reference component variables ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction e) // The expression shall not refer to elements of the component type of the optional runs on clause. module NegSem_05040101_parameters_of_kind_value_008 language "TTCN-3:2016" { type component GeneralComp { var integer vc_int := 0; } function f(in integer p_int := vc_int) runs on GeneralComp { } testcase TC_NegSem_05040101_parameters_of_kind_value_008() runs on GeneralComp { f(); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_value_008()); } }
ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_010.ttcn 0 → 100644 +33 −0 Original line number Original line Diff line number Diff line /*************************************************** ** @author STF 487 ** @version 0.0.1 ** @purpose 1:5.4.1.1, verify that default value of value formal parameters cannot invoke functions with runs on clause ** @verdict pass reject ***************************************************/ // The following requirement is tested: // Restriction e) // The expression shall not contain the invocation of functions with a runs on clause. module NegSem_05040101_parameters_of_kind_value_010 { type component GeneralComp { var integer vc_int; } function fx() runs on GeneralComp return integer { return vc_int + 1; } function f(in integer p_int := fx()) runs on GeneralComp { log(p_int); } testcase TC_NegSem_05040101_parameters_of_kind_value_010() runs on GeneralComp { f(); setverdict(pass); } control{ execute(TC_NegSem_05040101_parameters_of_kind_value_010()); } }
ATS/core_language/05_basic_language_elements/0504_parametrization/050401_formal_parameters/05040101_parameters_of_kind_value/NegSem_05040101_parameters_of_kind_value_019.ttcn 0 → 100644 +38 −0 Original line number Original line Diff line number Diff line /***************************************************************** ** @author STF 521 ** @version 0.0.1 ** @purpose 1:5.4.1.1, Verify that altsteps with port parameters cannot be used in component.start operation ** @verdict pass reject *****************************************************************/ // The following requirement is tested: // Only function and altstep definitions may have formal port parameters, - with the exception of functions or // altsteps started as test component behaviour (see clause 21.3.2). module NegSem_05040101_parameters_of_kind_value_019 { type port P message { inout integer } type component C { port P p; } altstep a_test(P p_port) runs on C { [] p_port.receive(integer:?) { setverdict(pass); } } testcase TC_NegSem_05040101_parameters_of_kind_value_019() runs on C system C { var C v_ptc := C.create; connect(mtc:p, mtc:p); p.send(1); v_ptc.start(a_test(p)); v_ptc.done; } control { execute(TC_NegSem_05040101_parameters_of_kind_value_019()); } } No newline at end of file